question about products
Hi everybody, I am writing a zope product (first time) and I would like to know if it is possible to test it without running Zope. The reason for this is because when there are mistakes Zope cannot compile the Python code and gives me the messages in the console, but I am running windows (it is not my choice) and I cannot redirect it to a file, and those errors get lost when scrolling the rest of the messages. Therefore, I would like to check the syntax errors before running Zope. The runtime errors present no problem because they can be later checked from the Zope environment. If anyone knows how to do it, I really would appreciate it. Thank you Juan.
Juan.Garcia.Arboleya@esa.int writes:
I am writing a zope product (first time) and I would like to know if it is possible to test it without running Zope. Yes, in some restricted way.
Assume, your Zope is not running (your "var/Data.fs" is not in use), then you can activate Zope in an interactive Python interpreter like this: python >>> from Zope import app >>> rootObject= app() # this is Zope's root object
From the rootObject, you can access all the other content in your site. You must extend PYTHONPATH for the above in order that the "Zope" package is found by Python's import machinery.
On <http://www.dieter.handshake.de/pyprojects/zope> you find a small module "interactive debugging support". It allows you to create an HTTP request and traverse it in the same way, ZPublisher would do. When you have a little money, you can look for WingIDE. It helps you a lot to develop your Zope products. Finally, you may activate Zope logging (see "doc/LOGGING.txt"). Most errors should go into the log file (if logging is enabled). Only stupid code writes in this case to stderr. Dieter
participants (2)
-
Dieter Maurer -
Juan.Garcia.Arboleyaï¼ esa.int