<s> from Products . CMFCore . DirectoryView import createDirectoryView <EOL> from Products . CMFCore . utils import getToolByName <EOL> from Products . CMFPlone . interfaces import ISelectableConstrainTypes <EOL> from Products . CMFEditions . setuphandlers import DEFAULT_POLICIES <EOL> import string <EOL> def setupSkins ( portal ) : <EOL> def add ( portal , name , location ) : <EOL> portal_skins = getToolByName ( portal , "<STR_LIT>" ) <EOL> if name not in portal_skins . objectIds ( ) : <EOL> createDirectoryView ( portal_skins , location , name ) <EOL> skins = portal_skins . getSkinSelections ( ) <EOL> for skin in skins : <EOL> path = portal_skins . getSkinPath ( skin ) <EOL> path = [ p . strip ( ) for p in path . split ( '<STR_LIT:U+002C>' ) ] <EOL> if name not in path : <EOL> if '<STR_LIT>' in path : <EOL> pos = path . index ( '<STR_LIT>' ) + <NUM_LIT:1> <EOL> else : <EOL> pos = <NUM_LIT:0> <EOL> path . insert ( pos , name ) <EOL> path = "<STR_LIT:U+002CU+0020>" . join ( path ) <EOL> portal_skins . addSkinSelection ( skin , path ) <EOL> add ( portal , "<STR_LIT>" , "<STR_LIT>" ) <EOL> def importVarious ( context ) : <EOL> if context . readDataFile ( "<STR_LIT>" ) is None : <EOL> return <EOL> portal = context . getSite ( ) <EOL> setupSkins ( portal ) </s>
