A milestone is a file containing the state of any object that has been hooked-up. While initializing a milestone, add the objects that you want to be dumped by appending keyworded arguments to the initializer or using the add(). By default the milestone tries to use the YAML format wich is human readable, if PyYAML is not installed, it uses pickling wich is not readable. You can force the use of pickling by setting the argument yaml to False.
In order to use efficiently this module, you must understand properly the assignement principles in Python. This module use the pointers you passed to dump the object, for example the following won’t work as desired
>>> my_object = [1, 2, 3]
>>> ms = Milestone(obj=my_object)
>>> my_object = [3, 5, 6]
>>> ms.dump("example")
>>> ms.load("example.ems")
>>> ms["obj"]
[1, 2, 3]
In order to dump the new value of my_object it is needed to change its internal values directly and not touch the label, as in the following
>>> my_object = [1, 2, 3]
>>> ms = Milestone(obj=my_object)
>>> my_object[:] = [3, 5, 6]
>>> ms.dump("example")
>>> ms.load("example.ems")
>>> ms["obj"]
[3, 5, 6]
Dump the current registered objects in a file named prefix.ems, the randomizer state is always added to the file and available under the "randomizer_state" tag.
Load a milestone file retreiving the dumped objects, it is not safe to load a milestone file in a milestone object that containing references as all conflicting names will be updated with the new values.
Add objects to the list of objects to be dumped. The object is added under the name specified by the argument’s name. Keyworded arguments are mandatory in this function.
Remove objects with the specified name from the list of objects to be dumped.