Edit

class photonforge.pda.Edit[source]

One change in a document’s chain, with the state it produced.

Methods

clear()

copy()

fromkeys([value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(k[,d])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

Attributes

changes

{path: (before, after)} for what this change moved.

heads

The document's heads once this change had landed.

index

Position in the chain, oldest first.

session

Short form of the actor that wrote it.

state

The whole document as it stood after this change.

property changes: dict[str, tuple]

{path: (before, after)} for what this change moved.

Paths are dotted, with list positions in brackets: parameters.radius, components[3].ref, layers.SiN.thickness. A subtree that appeared or vanished is one entry, with None on the side that had nothing.

property heads: tuple[str, ...]

The document’s heads once this change had landed.

The merged frontier, not the change’s own hash: with two sessions editing at once, a single hash names one branch’s view, and reading there would show the other session’s work as undone.

property index: int

Position in the chain, oldest first.

property session: str

Short form of the actor that wrote it. A session, not a person.

property state: dict

The whole document as it stood after this change.