Logo Search packages:      
Sourcecode: zope-cpsskins version File versions  Download package

def CPSSkins::PortalThemesTool::PortalThemesTool::getLocalThemes (   self,
  folder = None,

Return the list of local themes in a given context.

Definition at line 599 of file PortalThemesTool.py.

00599                                                :
        """Return the list of local themes in a given context.

        if folder is None:
            return []

        local_theme_id = self.getLocalThemeID()
        if getattr(aq_base(folder), local_theme_id, None) is None:
            return []

        theme_obj = getattr(folder, local_theme_id)
        if theme_obj and callable(theme_obj):
            theme_obj = apply(theme_obj, ())
        if isinstance(theme_obj, StringType):
            theme_obj = (theme_obj, )
        if not isinstance(theme_obj, TupleType):
            return []

        themes = []
        for l in theme_obj:
            if ':' not in l:
                themes.append(((0,0), l))
            nm, theme = l.split(':')
            if '-' not in nm:
            n, m = nm.split('-')
            themes.append(((int(n), int(m)), theme))
        return themes

    def _getLocalTheme(self, folder=None, level=None):

Generated by  Doxygen 1.6.0   Back to index