Back to index

plone3  3.1.7
Functions
kss.demo.configfeature.tests.__parent__ Namespace Reference

Functions

def __parent__

Function Documentation

def kss.demo.configfeature.tests.__parent__.__parent__ (   modulename,
  level = 1 
)

Definition at line 3 of file __parent__.py.

00003 
00004 def __parent__(modulename, level=1):
00005     'Figure out parent module'
00006     for i in range(level):
00007         if not isinstance(modulename, basestring):
00008             modulename = modulename.__name__
00009         modulename = sys.modules['.'.join(modulename.split('.')[:-1])]
00010     return modulename