[Zope] converting Python ap to Zope
Jerry McRae
Jerry McRae <jerry@usd1.com>
Fri, 30 Nov 2001 16:32:14 -0800
Hi ZoPeople,
I have searched and read everything I could find for weeks, I still
need help.
I am attempting to convert a Python application into Zope. I am having
much trouble creating a Product from this application because of some of
its dependances. The user interface is completely separate, so that is
not an issue.
I have tried loading the whole app as an external method, which didn't
work, but I learned to make a copy of ALL modules and place them in a
Zope sub-folder. The python path from my stand-alone python 2.1 didn't
get searched.
I am attempting to write a Product to access my application, but have
run into several errors mostly due to pickleing.
I would like to have the same code for my base classes, but I have the
following conundrums. Any pointers would be much appreciated.
1) There are a lot of classes and tables. Each user can create multiple
sets of the application classes and tables. Each set of instances and
attributes is pickled as a file. The application is basically just a
wrapper for the pickled instances. I can think of no way to convert the
pickle file into classes and attributes that Zope can see and/or modify.
It seems I will have to re-factor each and every python class as a Zope
class.
2) several specialized data files are involved, which are opened and
positioned based on the classes and parameters. The files are needed
for all aspects of the application. Since Zope cannot pickle open file
handles, I could store file names, positions, and other attributes, but
I don't know how to re-open the files any time Zope restarts so that the
user just references my object name (and methods) to access the data.
3) the key to accessing these specialized files is a windows .DLL file
that works great in Python, but is unpickleable (is that a word?) in
Zope. I think I want to create a function that gets loaded when the
Product does, but I cannot find any examples of Products that do this:
allow instanciated objects to call custom functions created from __init__.py in
a Product. There must be someplace to add globally available functions
to Zope outside of ZODB, yes?
--Jerry
--
/\_/\ Jerry McRae \|||/ mail safely: The Bat! 1.53d
(~o o~) (stuck in win98) (. .) Zope v2.4.1 - dryer than golf
)'Y'( _______________-o00-(_)-00o-____________________________________
( ) / Imagination rules the world. --Napoleon