[Zope] Zope debugging, TmpStorage and other stuff

Andrey V Khavryutchenko akhavr@compchem.kiev.ua
04 Jan 2000 01:19:32 +0200


Hi!

To set up the debugging framework for my application, I have to do
something that would:
 - construct the Zope object with temporary storage w/o starting any
servers
 - build my site in this Zope object (trivial, not a problem)
 - pass requests to this Zope object

Here's the sketch code:

# -*- python -*-
# sketch, not the real code

import Zope, ZPublisher, ZODB
Zope.DB = ZODB.TmpStore.TmpStore(Zope.Globals.DatabaseVersion)

# at this point I want to have Zope ready to serve using the temporary
# storage and w/o binding any inet ports

import mysite
mysite.build(Zope.root_folder)

# here my site is constructed in previously build Zope object

print ZPublisher.publish(Zope.root_folder, '/index_html')

# this prints the main page of my site

# end of python code



Questions:

(1) Will the stuff like this work?  Would somebody, knowledgeable of Zope
internals, to advise:
 - how to change ZODB storage?
 - how to access Zope root folder?
 - how correctly run requests against Zope object?

(2) Rather stupid.  I can't import Zope:

Python 1.5.2 (#2, Nov 24 1999, 21:47:58)  [GCC egcs-2.90.29 980515 (egcs-1.0.3 re on linux-%_target_cpu
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import sys
>>> sys.path.append('/usr/share/zope/lib/python')
>>> import Zope
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/share/zope/lib/python/Zope/__init__.py", line 95, in ?
    import Globals, OFS.Application, sys
  File "/usr/share/zope/lib/python/OFS/Application.py", line 96, in ?
    from AccessControl.User import UserFolder
  File "/usr/share/zope/lib/python/AccessControl/User.py", line 294, in ?
    raise 'InstallError', (
InstallError: No access file found at /usr/share/zope - see INSTALL.txt

Investigation shows that the problem is wrong content of INSTANCE_HOME, but 
I have some difficulties to figure out at midnight how to pass it into
AccessControl.User :)



Thanks in advance.

-- 
SY, Andrey V Khavryutchenko  http://www.kbi.kiev.ua/~akhavr
Software & SPI Engineer      Visit my site

Shick's Law:
	There is no problem a good miracle can't solve.