Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter Class Reference
Inheritance diagram for ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def listNonVersionedObjects
def removeNonVersionedData
def getNonVersionedData
def restoreNonVersionedData

Public Attributes

 obj
 attrs

Static Private Attributes

 __implements__ = INonVersionedData

Detailed Description

Non-versioned data adapter for arbitrary things.

Definition at line 78 of file nonversioned.py.


Constructor & Destructor Documentation

Definition at line 83 of file nonversioned.py.

00083 
00084     def __init__(self, obj):
00085         self.obj = obj
00086         # __vc_ignore__, if set, is a tuple of attribute names to
00087         # manage independently of version control.
00088         self.attrs = getattr(obj, "__vc_ignore__", ())


Member Function Documentation

Reimplemented in ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter.

Definition at line 101 of file nonversioned.py.

00101 
00102     def getNonVersionedData(self):
00103         data = {}
00104         for attr in self.attrs:
00105             if hasattr( aq_base(self.obj), attr ):
00106                 data[attr] = aq_base(getattr(aq_base(self.obj), attr))
00107         return data

Here is the caller graph for this function:

Reimplemented in ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter.

Definition at line 89 of file nonversioned.py.

00089 
00090     def listNonVersionedObjects(self):
00091         # Assume it's OK to clone all of the attributes.
00092         # They will be removed later by removeNonVersionedData.
00093         return ()

Reimplemented in ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter.

Definition at line 94 of file nonversioned.py.

00094 
00095     def removeNonVersionedData(self):
00096         for attr in self.attrs:
00097             try:
00098                 delattr(aq_base(self.obj), attr)
00099             except (AttributeError, KeyError):
00100                 pass

Reimplemented in ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter.

Definition at line 108 of file nonversioned.py.

00108 
00109     def restoreNonVersionedData(self, data):
00110         for attr in self.attrs:
00111             if data.has_key(attr):
00112                 setattr(aq_base(self.obj), attr, data[attr])
00113 


Member Data Documentation

Definition at line 87 of file nonversioned.py.

Definition at line 84 of file nonversioned.py.


The documentation for this class was generated from the following file: