Exemplo n.º 1
0
 def getCustomizableObject(self):
     ob = aq_parent(aq_inner(self))
     while ob:
         if IDirectoryView.providedBy(ob):
             ob = aq_parent(ob)
         else:
             break
     return ob
Exemplo n.º 2
0
def check_skins_tool(tool):
    """2.0.x to 2.1.0 upgrade step checker
    """
    stool = getToolByName(tool, 'portal_skins')
    for obj in stool.objectValues():
        if IDirectoryView.providedBy(obj):
            dirpath = obj.getDirPath()
            if dirpath is None:
                continue
            if dirpath not in _dirreg.listDirectories():
                return True
    return False
Exemplo n.º 3
0
def check_skins_tool(tool):
    """2.0.x to 2.1.0 upgrade step checker
    """
    stool = getToolByName(tool, 'portal_skins')
    for obj in stool.objectValues():
        if IDirectoryView.providedBy(obj):
            dirpath = obj.getDirPath()
            if dirpath is None:
                continue
            if dirpath not in _dirreg.listDirectories():
                return True
    return False
Exemplo n.º 4
0
def upgrade_skins_tool(tool):
    """2.0.x to 2.1.0 upgrade step handler
    """
    logger = logging.getLogger('GenericSetup.upgrade')
    stool = getToolByName(tool, 'portal_skins')
    for obj in stool.objectValues():
        if IDirectoryView.providedBy(obj):
            dirpath = obj.getDirPath()
            if dirpath is None:
                continue
            if dirpath not in _dirreg.listDirectories():
                obj._dirpath = _getCurrentKeyFormat(dirpath)
                logger.info("DirectoryView '%s' changed." % obj.getId())
Exemplo n.º 5
0
def upgrade_skins_tool(tool):
    """2.0.x to 2.1.0 upgrade step handler
    """
    logger = logging.getLogger('GenericSetup.upgrade')
    stool = getToolByName(tool, 'portal_skins')
    for obj in stool.objectValues():
        if IDirectoryView.providedBy(obj):
            dirpath = obj.getDirPath()
            if dirpath is None:
                continue
            if dirpath not in _dirreg.listDirectories():
                obj._dirpath = _getCurrentKeyFormat(dirpath)
                logger.info("DirectoryView '%s' changed." % obj.getId())
Exemplo n.º 6
0
 def getCustomizableObject(self):
     ob = aq_parent(aq_inner(self))
     while ob:
         if IDirectoryView.providedBy(ob):
             ob = aq_parent(ob)
         elif getattr(ob, '_isDirectoryView', 0):
             # BBB
             warn("The '_isDirectoryView' marker attribute is deprecated, "
                  "and will be removed in CMF 2.3.  Please mark the "
                  "instance with the 'IDirectoryView' interface instead.",
                  DeprecationWarning, stacklevel=2)
             ob = aq_parent(ob)
         else:
             break
     return ob
Exemplo n.º 7
0
 def getCustomizableObject(self):
     ob = aq_parent(aq_inner(self))
     while ob:
         if IDirectoryView.providedBy(ob):
             ob = aq_parent(ob)
         elif getattr(ob, '_isDirectoryView', 0):
             # BBB
             warn("The '_isDirectoryView' marker attribute is deprecated, "
                  "and will be removed in CMF 2.3.  Please mark the "
                  "instance with the 'IDirectoryView' interface instead.",
                  DeprecationWarning, stacklevel=2)
             ob = aq_parent(ob)
         else:
             break
     return ob