[Zope] how to import strptime.py to ZOPE WIN installation?

Michael Lausch mla@1012surf.net
22 Apr 2001 20:55:23 +0200


On 22 Apr 2001 19:18:58 +0200, Georg Rellensmann wrote:
> Hi,
>=20
> I want to do some form typechecking on the server side for date
> input. Strptime() is what I need, but the function is not part of the
> windows distribution. So I was happy to discover strptime.py from Andy
> Eskilsson (http://www.fukt.hk-r.se/~flognat), which works nicely from
> the commandline in PythonWin.
>=20
> But how the hell (sorry) can I get it "into" my Python/ZOPE
> installation? I=B4d like to call it from a Python script. Reading lots
> of list archives and the like didn=B4t give me a clue yet.
from the help function in Zope 2.3.1 i got the following info, which
actually works for me. I wanted to import urlparse into a pythin script.
In my /var/zope-2.3.1/Products directory (INSTANCEHOME, where i install
all my local and not "standard" Zope products) i created a directory
`Modules' and in this directory a file __init__.py in this file i wrote
the following:

from Products.PythonScripts.Utility import allow_module, allow_class
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
from Globals import InitializeClass

allow_module("urlparse");

and then i could import urlparse into a python script.

see also help->script(python)->allowing import of modules.

>=20
> Please help!
>=20
> Hope I am not off topic (is this a Python thing?), but others might be
> interested in strptime.py functionality as well.
>=20

--=20
Michael Lausch
See my web page <http://www.lausch.at/> or query PGP key server for PGP k=
ey.
"Reality is that which, when you stop believing in it, doesn't go away".
                -- Philip K. Dick