Package twisted :: Package persisted :: Module styles :: Class Versioned
[frames | no frames]

Class Versioned

Known Subclasses:
BuilderStatus, BuildMaster, BuildStatus, BuildStepStatus, Dispatcher

This type of object is persisted with versioning information.

I have a single class attribute, the int persistenceVersion. After I am unserialized (and styles.doUpgrade() is called), self.upgradeToVersionX() will be called for each version upgrade I must undergo.

For example, if I serialize an instance of a Foo(Versioned) at version 4 and then unserialize it when the code is at version 9, the calls:
 self.upgradeToVersion5()
 self.upgradeToVersion6()
 self.upgradeToVersion7()
 self.upgradeToVersion8()
 self.upgradeToVersion9()
will be made. If any of these methods are undefined, a warning message will be printed.
Method Summary
  __getstate__(self, dict)
Get state, adding a version number to it on its way out.
  __setstate__(self, state)
  versionUpgrade(self)
(internal) Do a version upgrade.

Class Variable Summary
Implements __implemented__ = <implementedBy twisted.persisted.style...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
tuple persistenceForgets = ()
int persistenceVersion = 0                                                                     

Method Details

__getstate__(self, dict=None)

Get state, adding a version number to it on its way out.

versionUpgrade(self)

(internal) Do a version upgrade.

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy twisted.persisted.styles.Versioned>                     

__providedBy__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x4062396c>       

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x4062396c>       

persistenceForgets

Type:
tuple
Value:
()                                                                     

persistenceVersion

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Sun Dec 10 22:04:44 2006 http://epydoc.sf.net