Trees | Index | Help |
|
---|
Module Cerealizer |
|
Classes | |
---|---|
BoolHandler |
|
ComplexHandler |
|
DictHandler |
|
Dumper |
|
FloatHandler |
|
FrozensetHandler |
|
Handler |
Handler |
InitArgsObjHandler |
InitArgsObjHandler |
IntHandler |
|
ListHandler |
|
LongHandler |
|
NewArgsObjHandler |
NewArgsObjHandler |
NoneHandler |
|
ObjHandler |
ObjHandler |
RefHandler |
|
SetHandler |
|
SlotedObjHandler |
SlotedObjHandler |
StrHandler |
|
TupleHandler |
|
UnicodeHandler |
Exceptions | |
---|---|
NonCerealizableObjectError |
|
NotCerealizerFileError |
Function Summary | |
---|---|
dump(obj, file, protocol = 0) | |
dump_class_of_module(*modules) | |
dumps(obj, protocol = 0) -> str | |
freeze_configuration() | |
load(file) -> obj | |
loads(file) -> obj | |
register(Class, handler = None, classname = "") | |
register_alias(Class, alias) Registers ALIAS as an alias classname for CLASS. | |
register(Class, handler = None, classname = "") | |
_priority_sorter(a,
b)
|
Variable Summary | |
---|---|
list |
__alls__ = ['load', 'dump', 'loads', 'dumps', 'freeze_co...
|
dict |
_HANDLERS_ = {<type 'NoneType'>: <Cerealizer.NoneHandler...
|
Logger |
logger = <logging.Logger instance at 0x3bcbecac>
|
str |
VERSION = '0.5'
|
int |
_configurable = 1 |
dict |
_HANDLERS = {'tuple\n': <Cerealizer.TupleHandler object ...
|
Function Details |
---|
dump(obj, file, protocol=0)dump(obj, file, protocol = 0) Serializes object OBJ in FILE. PROTOCOL is unused, it exists only for compatibility with Pickle. |
dump_class_of_module(*modules)dump_class_of_module(*modules) Utility function; for each classes found in the given module, print the needed call to register. |
dumps(obj, protocol=0)dumps(obj, protocol = 0) -> str Serializes object OBJ and returns the serialized string. PROTOCOL is unused, it exists only for compatibility with Pickle. |
freeze_configuration()freeze_configuration() Ends Cerealizer configuration. When freeze_configuration() is called, it is no longer possible to register classes, using register(). Calling freeze_configuration() is not mandatory, but it may enforce security, by forbidding unexpected calls to register(). |
load(file)load(file) -> obj De-serializes an object from FILE. |
loads(string)loads(file) -> obj De-serializes an object from STRING. |
register(Class, handler=None, classname='')register(Class, handler = None, classname = "") Registers CLASS as a serializable and secure class. By calling register, YOU HAVE TO ASSUME THAT THE FOLLOWING METHODS ARE SECURE:
HANDLER is the Cerealizer Handler object that handles serialization and deserialization for Class. If not given, Cerealizer create an instance of ObjHandler, which is suitable for old-style and new_style Python class, and also C-defined types (although if it has some C-side data, you may have to write a custom Handler or a __getstate__ and __setstate__ pair). CLASSNAME is the classname used in Cerealizer files. It defaults to the full classname (module.class) but you may choose something shorter -- as long as there is no risk of name clash. |
register_alias(Class, alias)register_alias(Class, alias) Registers ALIAS as an alias classname for CLASS. Usefull for keeping backward compatibility in files: e.g. if you have renamed OldClass to NewClass, just do: cerealizer.register_alias(NewClass, "OldClass") and you'll be able to open old files containing OldClass serialized. |
register_class(Class, handler=None, classname='')register(Class, handler = None, classname = "") Registers CLASS as a serializable and secure class. By calling register, YOU HAVE TO ASSUME THAT THE FOLLOWING METHODS ARE SECURE:
HANDLER is the Cerealizer Handler object that handles serialization and deserialization for Class. If not given, Cerealizer create an instance of ObjHandler, which is suitable for old-style and new_style Python class, and also C-defined types (although if it has some C-side data, you may have to write a custom Handler or a __getstate__ and __setstate__ pair). CLASSNAME is the classname used in Cerealizer files. It defaults to the full classname (module.class) but you may choose something shorter -- as long as there is no risk of name clash. |
Variable Details |
---|
__alls__
|
logger
|
VERSION
|
_configurable
|
_HANDLERS
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Aug 31 00:17:50 2006 | http://epydoc.sf.net |