6. Public References

build(model)
Return type:Node instance
Parameters:model (str) – model used to builf the actions tree

Parse the model and build a tree according to it

p_build(model[, filename])
Return type:

Node instance

Parameters:
  • model (str) – model used to builf the actions tree
  • filenamename (str) – filename used to store or load a serialized copy of the built tree. The defaults value is ‘.actions_tree’

This function is the same as build() except that it make an SHA512 checksum of the model, and compare it with the one stored in the file named filename. If the file exists and the checksum stored in it is the same, it loads and return the previously built tree. Else, it build the tree, creates the file filename and store in it the checksum and the pickled tree.

data_encode(iterable[, size_num_bytes])
Return type:

str

Parameters:
  • iterable (iterable) – the iterable object must contain only str
  • size_num_bytes (int) – number of bytes that will be used to represent a size, default is 2

returns a str containing all the str in iterable along with their size

data_decode(data[, size_num_bytes])
Return type:

list

Parameters:
  • data (str) – the str produced by data_encode()
  • size_num_bytes (int) – number of bytes that will be used to represent a size, default is 2

return all the original str be sure to use the same size_num_bytes as the one you used in data_encode()

p_data_encode(iterable[, size_num_bytes])
Return type:str

same as data_encode(), except that iterable can be populated by any “pickleable” object. Uses pickle.dumps( obj ,2) to serialize objects.

p_data_decode(iterable[, size_num_bytes])
Return type:list

recovers the list of objects serialized by p_data_decode()

Previous topic

5. Workflow

This Page