Skip to content
campadrenalin edited this page Sep 14, 2011 · 3 revisions

ConcurrenTree.model.operation

Operation

A subclass of ConcurrenTree.model.ModelBase, which provides the function __str__ and the property hash, which are a strict string of the protocol representation and the checksum of the protocol representation, respectively.

Methods:
* __init__(instructions = [], protostring = None) # Protostring overrides instructions, if given
* apply(tree) # Assuming tree is the root, apply all instructions to tree
* ready(tree) # Returns True if you can safely apply, False if some dependencies aren't supplied
* compress() # Reorganizes instructions for efficiency. Only affects instructions with overlapping deletions.
* proto() # Return protocol representation (dict)

Properties:
* inserts # The insertions in the instruction list
* dep_provides # The nodes this op provides (expressed as addresses)
* dep_requires # The addresses that must be valid in the tree before ready(tree) == True

Exceptions

  • ParseError(SyntaxError)
  • OpApplyError(SyntaxError)

Python Library

Clone this wiki locally