Die Funktion install_subskin

Django, Flask, Bottle, WSGI, CGI…
Antworten
Alex_winf01
User
Beiträge: 28
Registriert: Samstag 5. Februar 2005, 19:35

Samstag 2. Juli 2005, 20:03

Leider muss ich Euch noch einmal wegen einer "Lapalie" belästigen.

Die Funktion install_subskin ist im Produkt Archetypes im Unterordner Extensions im Python-Skript utils wie folgt definiert:

Code: Alles auswählen

def install_subskin(self, out, globals=types_globals,
                    product_skins_dir='skins'):
    skinstool=getToolByName(self, 'portal_skins')

    fullProductSkinsPath = join(package_home(globals), product_skins_dir)
    productSkinsPath = minimalpath(fullProductSkinsPath)
    registered_directories = manage_listAvailableDirectories()
    if productSkinsPath not in registered_directories:
        registerDirectory(product_skins_dir, globals)
    try:
        addDirectoryViews(skinstool, product_skins_dir, globals)
    except BadRequestException, e:
        pass  # directory view has already been added

    files = os.listdir(fullProductSkinsPath)
    for productSkinName in files:
        if (isdir(join(fullProductSkinsPath, productSkinName))
            and productSkinName != 'CVS'
            and productSkinName != '.svn'):
            for skinName in skinstool.getSkinSelections():
                path = skinstool.getSkinPath(skinName)
                path = [i.strip() for i in  path.split(',')]
                try:
                    if productSkinName not in path:
                        path.insert(path.index('custom') +1, productSkinName)
                except ValueError:
                    if productSkinName not in path:
                        path.append(productSkinName)
                path = ','.join(path)
                skinstool.addSkinSelection(skinName, path)
Leider ist mir nicht ganz klar, was diese Funktion machen soll. Kann mir jemand helfen?
Antworten