[Zope-CMF] Can't export to a Zope CMF Red Hat 9 Server
Troy Farrell
troy@entheossoft.com
Wed, 07 May 2003 16:15:03 -0500
Filesystem Directory Views are special zope objects that take a
directory of files and create proxy objects to represent the items in
the filesystem. This allows us to distribute python scripts as files
instead of .zexp zope imports. These FDV's store the path to the
directory as a string. When you moved from W32 to Linux, you needed to
change the path. That's what the script does...
Someone correct me if I'm wronge (please :)
Troy
David Cain wrote:
> Thanks Gentlement it worked.
>
> I'm still learning python, so can someone explain to me what this does,
> and what Filesystem Directory Views are?
>
> Thanks
>
> -----Original Message-----
> From: Troy Farrell [mailto:troy@entheossoft.com]
> Sent: Wednesday, May 07, 2003 1:24 PM
> To: Romain Slootmaekers
> Cc: David Cain; zope-cmf@zope.org
> Subject: Re: [Zope-CMF] Can't export to a Zope CMF Red Hat 9 Server
>
>
> Hehe. I knew that...
> I even stole this script from zopelabs. Put it in portal_skins and use
> the test tab to run it.
>
> ## Script (Python) "setSkinDirPath"
> ##bind container=container
> ##bind context=context
> ##bind namespace=
> ##bind script=script
> ##bind subpath=traverse_subpath
> ##parameters=
> ##title=
> ##
> import string
>
> #get possible skins
> newDirs=container.manage_addProduct['CMFCore'].manage_listAvailableDirec
> tories()
>
> #we can not use os.sep so we must look ourselfs what
> # the path separator is
> if newDirs[0].find('/') > -1:
> newSep = '/'
> else:
> newSep = '\\'
>
>
>
> objs = context.objectItems('Filesystem Directory View')
> for n,o in objs:
> found = 0
> path = o.getDirPath()
> if path.find('/') > -1:
> sep = '/'
> else:
> sep = '\\'
> #look for new path by comparing the last 2 elements
> dArr = string.split(path,sep)
> for i in range(len(newDirs)):
> # if we found the directory skip the rest
> if found:
> continue
> ndArr = string.split(newDirs[i],newSep)
> if string.lower(ndArr[-1]) != string.lower(dArr[-1]):
> continue
> if string.lower(ndArr[-2]) != string.lower(dArr[-2]):
> continue
> # if we land here, we found the real one
> found = 1
> o.manage_properties(dirpath = newDirs[i])
> if(found == 0):
> print path, ' not found'
>
> print 'finished'
> return printed
> #end script
>
> Hope that makes it less painful.
> Troy
>
> Romain Slootmaekers wrote:
>
>>the problem is most likely the FileSystem directory views..... these
>>have absolute paths... and must be changed manually or with a
>>script....
>>
>>click on portal_skins and on Images then on properties
>>and modify the culprit.
>>do this for all skins.
>>have fun. ;)
>>
>>Romain.
>
>
>