[Zope] Manage_addLocalFS

Janko Hauser jh@comunit.de
Sat, 11 Jan 2003 21:31:07 +0100


This method adds a localfs instance to a container. There is no check
if the id is already present, as I use it during product
initialization. So be careful :-) (This is only useful in a product or
perhaps in an external method)


    def createLocalFSView(self, path):
        id = 'ftp' 
        username = None
        passwd = None
        ob = LocalFS(id, 'map ftp', path, username, passwd)
        self._setObject(id, ob)

        # change the typecodes, so that images are mapped to
        # eDitoImages.
        ftp = getattr(self,'ftp')
        ftp._type_map = special_type_map
        ftp.type_map = special_type_map

and the corresponding import

from Products.LocalFS.LocalFS import LocalFS


HTH,

__Janko

On Sat, 11 Jan 2003 15:50:56 +0100
Milos Prudek <milos.prudek@tiscali.cz> wrote:

> > I do not have "LocalFS" installed and can therefor not check
> > which parameters "manage_addLocalFS" expects.
> 
> OK, I did not know that, sorry to bother you.
> 
> LocalFS's TODO file says that "- Fix manage_add methods." is a High 
> Priority todo... therefore I was afraid that maybe manage_addLocalFS
> is broken... that's why I asked here and CC'd the author of LocalFS.
> 
> I'll try to post it on the project's mailing list.
> 
> Thank you for your time, Dieter.
> 
> -- 
> Milos Prudek
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


-- 
i.A. Dr. Janko Hauser
Software Engineering
c o m . u n i t   G m b H
online-schmiede seit 1994

http://www.comunit.de/	mailto:jh@comunit.de
Eiffestr. 598		20537 Hamburg | Germany
Fon 040 | 21 11 05 25	Fax  040 | 21 11 05 26