Back to index

plone3  3.1.7
Classes | Functions | Variables
PortalTransforms.Transform Namespace Reference

Classes

class  Transform

Functions

def import_from_name
def make_config_persistent
def make_config_nonpersistent

Variables

string __revision__ = '$Id: Transform.py 7958 2007-04-27 22:09:16Z wichert $'
dictionary VALIDATORS

Function Documentation

import and return a module by its name 

Definition at line 23 of file Transform.py.

00023 
00024 def import_from_name(module_name):
00025     """ import and return a module by its name """
00026     __traceback_info__ = (module_name, )
00027     m = __import__(module_name)
00028     try:
00029         for sub in module_name.split('.')[1:]:
00030             m = getattr(m, sub)
00031     except AttributeError, e:
00032         raise ImportError(str(e))
00033     return m

Here is the caller graph for this function:

iterates on the given dictionary and replace ListClass by python List,
    and DictClass by python Dict

Definition at line 46 of file Transform.py.

00046 
00047 def make_config_nonpersistent(kwargs):
00048     """ iterates on the given dictionary and replace ListClass by python List,
00049         and DictClass by python Dict
00050     """
00051     for key, value in kwargs.items():
00052         if isinstance(value, PersistentMapping):
00053             p_value = dict(value)
00054             kwargs[key] = p_value
00055         elif isinstance(value, PersistentList):
00056             p_value = list(value)
00057             kwargs[key] = p_value

Here is the call graph for this function:

iterates on the given dictionnary and replace list by persistent list,
dictionary by persistent mapping.

Definition at line 34 of file Transform.py.

00034 
00035 def make_config_persistent(kwargs):
00036     """ iterates on the given dictionnary and replace list by persistent list,
00037     dictionary by persistent mapping.
00038     """
00039     for key, value in kwargs.items():
00040         if type(value) == type({}):
00041             p_value = PersistentMapping(value)
00042             kwargs[key] = p_value
00043         elif type(value) in (type(()), type([])):
00044             p_value = PersistentList(value)
00045             kwargs[key] = p_value


Variable Documentation

string PortalTransforms.Transform.__revision__ = '$Id: Transform.py 7958 2007-04-27 22:09:16Z wichert $'

Definition at line 21 of file Transform.py.

Initial value:
00001 {
00002     'int' : int,
00003     'string' : str,
00004     'list' : PersistentList,
00005     'dict' : PersistentMapping,
00006     }

Definition at line 58 of file Transform.py.