def getCustomizableObject(self): ob = aq_parent(aq_inner(self)) while ob: if IDirectoryView.providedBy(ob): ob = aq_parent(ob) else: break return ob
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
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
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())
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())
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
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