Table of Contents

Class: Versioned Twisted-0.19.0/twisted/persisted/styles.py

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.

Methods   
__getstate__
__setstate__
versionUpgrade
  __getstate__ 
__getstate__ ( self,  dict=None )

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

  __setstate__ 
__setstate__ ( self,  state )

  versionUpgrade 
versionUpgrade ( self )

(internal) Do a version upgrade.


Table of Contents

This document was automatically generated on Sun Jul 14 19:52:54 2002 by HappyDoc version 2.0