On Sat, 2003-10-11 at 10:30, Ted holden wrote:
I notice that zope doesn't like the idea of the file containing functions for use as external modules containing global variable assignments.
Zope is a development framework. As such, there is a lot more going on than setting some variables and maintaining state. Zope is great for building web-fronted apps, but it does have conventions and idioms that must be learned before you will have any significant success. Zope is not the kind of system that reveals itself in a few hours of tinkering. That said, I'm guessing that your "global" is only in scope during the execution of the external method. There *are* ways to persist data (from *any* kind of method) but I don't think you're using one of them.
For that matter, zope doesn't seem to be able to deal with python classes either.
Zope is pretty easily extended with Python classes... you just have to know how to set them up and register them. But check first to make sure someone else hasn't already developed what you think you need. Odds are, someone probably has.
I have an application which in its pygtk version consists of a number of global assignments, a number of function definitions, and finally a
gtk.main()
line.
HTTP is a stateless protocol. A Zope app can keep enough information between requests to simulate state. But you don't use the main() idiom in Zope programming at all. You build each interface to (mostly) stand alone. The user should experience them as a coherent whole, but that isn't how they are (generally) designed.
I wish to create a zope version of the same application and one requirement for that is that the application retain its state (global variables) somehow or other.
There are several mechanisms for storing information that can be made available however you want it. But unless you take steps to persist data, most assignments you make are local to a period of time... the duration of each request. "Global" has far less meaning in an app with no temporal continuity. Read at least the first few chapters of the Zope Book... it'll help clear things up a lot. After that, feel free to let us know when you have specific questions. http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition HTH, Dylan