pyams_zodbbrowser package ⊞¶
Subpackages¶
pyams_zodbbrowser.btreesupport¶
BTrees are commonly used in the Zope world. This modules exposes the contents of BTrees nicely, abstracting away the implementation details.
In the DB, every BTree can be represented by more than one persistent object, every one of those versioned separately. This is part of what makes BTrees efficient.
The format of the picked BTree state is nicely documented in ZODB’s source code, specifically, BTreeTemplate.c and BucketTemplate.c.
-
class
pyams_zodbbrowser.btreesupport.BTreeContainerState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateConvenient access to a BTreeContainer’s items
-
class
pyams_zodbbrowser.btreesupport.EmptyOOBTreeState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.btreesupport.OOBTreeStateEmpty OOBTrees pickle to None.
-
class
pyams_zodbbrowser.btreesupport.FolderState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateConvenient access to a Folder’s items
-
class
pyams_zodbbrowser.btreesupport.OOBTreeState(type, state, tid)[source]¶ Bases:
objectNon-empty OOBTrees have a complicated tuple structure.
-
class
pyams_zodbbrowser.btreesupport.OOBucketState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateA single OOBTree bucket, should you wish to look at the internals
Here’s the state description direct from BTrees/BucketTemplate.c:
* For a set bucket (self->values is NULL), a one-tuple or two-tuple. The * first element is a tuple of keys, of length self->len. The second element * is the next bucket, present if and only if next is non-NULL: * * ( * (keys[0], keys[1], ..., keys[len-1]), * <self->next iff non-NULL> * ) * * For a mapping bucket (self->values is not NULL), a one-tuple or two-tuple. * The first element is a tuple interleaving keys and values, of length * 2 * self->len. The second element is the next bucket, present iff next is * non-NULL: * * ( * (keys[0], values[0], keys[1], values[1], ..., * keys[len-1], values[len-1]), * <self->next iff non-NULL> * )
OOBucket is a mapping bucket; OOSet is a set bucket.
pyams_zodbbrowser.cache¶
pyams_zodbbrowser.diff¶
-
pyams_zodbbrowser.diff.compareDictsHTML(new, old, tid=None, indent='')[source]¶ Compare two state dictionaries, return HTML.
-
pyams_zodbbrowser.diff.compareTuples(new, old)[source]¶ Compare two tuples.
Return (common_prefix, middle_of_old, middle_of_new, common_suffix)
pyams_zodbbrowser.history¶
pyams_zodbbrowser.state¶
-
class
pyams_zodbbrowser.state.DecoyPersistentDict(**kwargs)[source]¶ Bases:
persistent.mapping.PersistentMappingDecoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.
-
class
pyams_zodbbrowser.state.FallbackState(type, state, tid)[source]¶ Bases:
objectFallback when we’ve got no idea how to interpret the state
-
class
pyams_zodbbrowser.state.GenericState(type, state, tid)[source]¶ Bases:
objectMost persistent objects represent their state as a dict.
-
class
pyams_zodbbrowser.state.LoadErrorState(error, tid)[source]¶ Bases:
objectPlaceholder for when an object’s state could not be loaded
-
class
pyams_zodbbrowser.state.OrderedContainerState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateConvenient access to an OrderedContainer’s items
-
class
pyams_zodbbrowser.state.PersistentDictState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.PersistentMappingStateDecoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.
-
class
pyams_zodbbrowser.state.PersistentMappingState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateConvenient access to a persistent mapping’s items.
-
class
pyams_zodbbrowser.state.SampleContainerState(type, state, tid)[source]¶ Bases:
pyams_zodbbrowser.state.GenericStateConvenient access to a SampleContainer’s items
-
pyams_zodbbrowser.state.install_provides_hack()[source]¶ Monkey-patch zope.interface.Provides with a more lenient version.
A common result of missing modules in sys.path is that you cannot unpickle objects that have been marked with directlyProvides() to implement interfaces that aren’t currently available. Those interfaces are replaced by persistent broken placeholders, which aren classes, not interfaces, and aren’t iterable, causing TypeErrors during unpickling.
pyams_zodbbrowser.value¶
-
class
pyams_zodbbrowser.value.DecoyPersistentDict(**kwargs)[source]¶ Bases:
persistent.mapping.PersistentMappingDecoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.
-
class
pyams_zodbbrowser.value.GenericValue(context)[source]¶ Bases:
objectDefault value renderer.
Uses the object’s __repr__, truncating if too long.
-
class
pyams_zodbbrowser.value.PersistentDictValue(context)[source]¶ Bases:
pyams_zodbbrowser.value.PersistentValueDecoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.
-
class
pyams_zodbbrowser.value.PersistentValue(context)[source]¶ Bases:
objectPersistent object renderer.
Uses __repr__ and makes it a hyperlink to the actual object.
-
delegate_to¶ alias of
GenericValue
-
view_name= '#zodbbrowser'¶
-
-
class
pyams_zodbbrowser.value.ProvidesValue(context)[source]¶ Bases:
pyams_zodbbrowser.value.GenericValuezope.interface.Provides object renderer.
The __repr__ of zope.interface.Provides is decidedly unhelpful.
-
class
pyams_zodbbrowser.value.StringValue(context)[source]¶ Bases:
pyams_zodbbrowser.value.GenericValueString renderer.