Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
GenericSetup.upgrade.UpgradeRegistry Class Reference

List of all members.

Public Member Functions

def __init__
def __getitem__
def keys
def clear
def getUpgradeStepsForProfile
def getUpgradeStep

Private Attributes

 _registry

Detailed Description

Registry of upgrade steps, by profile.

Registry keys are profile ids.

Each registry value is a nested mapping:
  - id -> step for single steps
  - id -> [ (id1, step1), (id2, step2) ] for nested steps

Definition at line 18 of file upgrade.py.


Constructor & Destructor Documentation

Definition at line 27 of file upgrade.py.

00027 
00028     def __init__(self):
00029         self._registry = OOBTree()


Member Function Documentation

Definition at line 30 of file upgrade.py.

00030 
00031     def __getitem__(self, key):
00032         return self._registry.get(key)

Here is the caller graph for this function:

Definition at line 36 of file upgrade.py.

00036 
00037     def clear(self):
00038         self._registry.clear()

Here is the caller graph for this function:

def GenericSetup.upgrade.UpgradeRegistry.getUpgradeStep (   self,
  profile_id,
  step_id 
)
Returns the specified upgrade step for the specified
profile, or None if it doesn't exist.

Definition at line 50 of file upgrade.py.

00050 
00051     def getUpgradeStep(self, profile_id, step_id):
00052         """Returns the specified upgrade step for the specified
00053         profile, or None if it doesn't exist.
00054         """
00055         profile_steps = self._registry.get(profile_id, None)
00056         if profile_steps is not None:
00057             step = profile_steps.get(step_id, None)
00058             if step is None:
00059                 for key in profile_steps.keys():
00060                     if type(profile_steps[key]) == list:
00061                         subs = dict(profile_steps[key])
00062                         step = subs.get(step_id, None)
00063                         if step is not None:
00064                             break
00065             elif type(step) == list:
00066                 subs = dict(step)
00067                 step = subs.get(step_id, None)
00068             return step

Here is the call graph for this function:

Return the upgrade steps mapping for a given profile, or
None if there are no steps registered for a profile matching
that id.

Definition at line 39 of file upgrade.py.

00039 
00040     def getUpgradeStepsForProfile(self, profile_id):
00041         """Return the upgrade steps mapping for a given profile, or
00042         None if there are no steps registered for a profile matching
00043         that id.
00044         """
00045         profile_steps = self._registry.get(profile_id, None)
00046         if profile_steps is None:
00047             self._registry[profile_id] = OOBTree()
00048             profile_steps = self._registry.get(profile_id)
00049         return profile_steps

Definition at line 33 of file upgrade.py.

00033 
00034     def keys(self):
00035         return self._registry.keys()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 28 of file upgrade.py.


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