Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
migrate_ptk.SimpleClassConverter Class Reference
Inheritance diagram for migrate_ptk.SimpleClassConverter:
Inheritance graph
[legend]
Collaboration diagram for migrate_ptk.SimpleClassConverter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def allowDescendChildren
def showDuplicationError
def convert

Private Attributes

 _klass
 _descend
 _show_dup

Detailed Description

Definition at line 113 of file migrate_ptk.py.


Constructor & Destructor Documentation

def migrate_ptk.SimpleClassConverter.__init__ (   self,
  to_class,
  descend,
  show_dup = 1 
)

Definition at line 114 of file migrate_ptk.py.

00114 
00115     def __init__(self, to_class, descend, show_dup=1):
00116         self._klass = to_class
00117         self._descend = descend
00118         self._show_dup = show_dup


Member Function Documentation

Reimplemented from migrate_ptk.Converter.

Definition at line 119 of file migrate_ptk.py.

00119 
00120     def allowDescendChildren(self):
00121         return self._descend

def migrate_ptk.SimpleClassConverter.convert (   self,
  ob 
)

Reimplemented from migrate_ptk.Converter.

Definition at line 125 of file migrate_ptk.py.

00125 
00126     def convert(self, ob):
00127         # Creates a copy of ob without its children.
00128         ob = aq_base(ob)
00129         k = self._klass
00130         if hasattr(k, '__basicnew__'):
00131             newob = k.__basicnew__()
00132         else:
00133             newob = new.instance(k, {})
00134         id = ob.id
00135         if callable(id):
00136             id = id()
00137         try: newob._setId(id)
00138         except AttributeError: newob.id = id
00139         newob.__dict__.update(ob.__dict__)
00140         if hasattr(newob, '_objects'):
00141             # Clear the children.
00142             for info in newob._objects:
00143                 del newob.__dict__[info['id']]
00144             newob._objects = ()
00145         if hasattr(newob, '_container'):
00146             # Clear the children.
00147             newob._container = PersistentMapping()
00148         return newob

Here is the caller graph for this function:

Reimplemented from migrate_ptk.Converter.

Definition at line 122 of file migrate_ptk.py.

00122 
00123     def showDuplicationError(self):
00124         return self._show_dup


Member Data Documentation

Definition at line 116 of file migrate_ptk.py.

Definition at line 115 of file migrate_ptk.py.

Definition at line 117 of file migrate_ptk.py.


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