Back to index

plone3  3.1.7
Classes | Functions | Variables
GenericSetup.upgrade Namespace Reference

Classes

class  UpgradeRegistry
class  UpgradeStep

Functions

def _registerUpgradeStep
def _registerNestedUpgradeStep
def _extractStepInfo
def listProfilesWithUpgrades
def listUpgradeSteps

Variables

tuple _upgrade_registry = UpgradeRegistry()

Function Documentation

def GenericSetup.upgrade._extractStepInfo (   tool,
  id,
  step,
  source 
) [private]
Returns the info data structure for a given step.

Definition at line 126 of file upgrade.py.

00126 
00127 def _extractStepInfo(tool, id, step, source):
00128     """Returns the info data structure for a given step.
00129     """
00130     proposed = step.isProposed(tool, source)
00131     if (not proposed
00132         and source is not None
00133         and (step.source is None or source > step.source)):
00134         return
00135     info = {
00136         'id': id,
00137         'step': step,
00138         'title': step.title,
00139         'source': step.source,
00140         'dest': step.dest,
00141         'description': step.description,
00142         'proposed': proposed,
00143         'sortkey': step.sortkey,
00144         }
00145     return info

Here is the caller graph for this function:

def GenericSetup.upgrade._registerNestedUpgradeStep (   step,
  outer_id 
) [private]

Definition at line 119 of file upgrade.py.

00119 
00120 def _registerNestedUpgradeStep(step, outer_id):
00121     profile_id = step.profile
00122     profile_steps = _upgrade_registry.getUpgradeStepsForProfile(profile_id)
00123     nested_steps = profile_steps.get(outer_id, [])
00124     nested_steps.append((step.id, step))
00125     profile_steps[outer_id] = nested_steps

Definition at line 114 of file upgrade.py.

00114 
00115 def _registerUpgradeStep(step):
00116     profile_id = step.profile
00117     profile_steps = _upgrade_registry.getUpgradeStepsForProfile(profile_id)
00118     profile_steps[step.id] = step

Here is the caller graph for this function:

Definition at line 146 of file upgrade.py.

00146 
00147 def listProfilesWithUpgrades():
00148     return _upgrade_registry.keys()

def GenericSetup.upgrade.listUpgradeSteps (   tool,
  profile_id,
  source 
)
Lists upgrade steps available from a given version, for a given
profile id.

Definition at line 149 of file upgrade.py.

00149 
00150 def listUpgradeSteps(tool, profile_id, source):
00151     """Lists upgrade steps available from a given version, for a given
00152     profile id.
00153     """
00154     res = []
00155     profile_steps = _upgrade_registry.getUpgradeStepsForProfile(profile_id)
00156     for id, step in profile_steps.items():
00157         if type(step) == UpgradeStep:
00158             info = _extractStepInfo(tool, id, step, source)
00159             if info is None:
00160                 continue
00161             res.append(((step.source or '', step.sortkey, info['proposed']), info))
00162         else: # nested steps
00163             nested = []
00164             outer_proposed = False
00165             for inner_id, inner_step in step:
00166                 info = _extractStepInfo(tool, inner_id, inner_step, source)
00167                 if info is None:
00168                     continue
00169                 nested.append(info)
00170                 outer_proposed = outer_proposed or info['proposed']
00171             if nested:
00172                 src = nested[0]['source']
00173                 sortkey = nested[0]['sortkey']
00174                 res.append(((src or '', sortkey, outer_proposed), nested))
00175     res.sort()
00176     res = [i[1] for i in res]
00177     return res

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 69 of file upgrade.py.