[Zope] Accessing Files within Zope?

Andreas Lauser and@poware.org
Fri, 5 Jul 2002 12:31:32 +0200


On Friday 05 July 2002 06:58, Dianne Van Dulken wrote:
> Hi all,
>
> I have just set up a folder which is designed to contain details of all=
 our
> users.  I've set up a ZClass for these users.
>
> The problem I am having is the transferance from our old system to our =
new
> one.  I have a file containing all the email addresses of the old users
> (which is all I need initially), one per line, and want to write a scri=
pt
> that steps through this file and processes the users into the Zope
> interface.
>
> The problem I am having is that I am finding it impossible to actually =
open
> the file within zope so you can actually use it.  I've tried scripting =
with
>
> filein =3D open(file)

Write an external method or load the file into the zope database via the=20
management screens.

> I've tried it in Zope methods with
>
> "<dtml-in "_.getitem(file).split('\n')">
>
> But that assumes it is a string (I admit, it was wishful thinking when =
I
> tried that).
>
> Does anyone know of a way to read a text file, contained in zope, and s=
tep
> through it?  I've looked in the archives, and not found a way.

save that file as DTML-Document, not as file. then you can achieve what y=
ou=20
intent with  <dtml-in "nameOfYourDataObject().split('\n')">

mfg
  AND

--=20
I doubt, therefore I might be.