durusmail: quixote-users: import and export - help!
import and export - help!
2004-04-18
Re: import and export - help!
2004-04-19
2004-04-20
2004-04-20
2004-04-20
2004-04-20
2004-04-21
2004-04-21
Jason E. Sibre (2 parts)
2004-04-21
Re: import and export - help! (resolved)
2004-04-21
2004-04-20
2004-04-20
import and export - help!
John Miller
2004-04-18
I'm just beginning to use quixote (and I'm a fairly beginner python
programmer) and I'm wondering if someone can help me troubleshoot what
should be an easy task. I've installed quixote on MacOS X 10.3.3
running Apache and I've configured it to run .cgi scripts. The demo
that comes with quixote runs flawlessly. My next step in the learning
curve is to get the qxdemo running *as a .cgi application* (not with
medusa). This is the demo that comes with the tutorial at:
http://quixote.ca/files/qxdemo/ . I installed the demo using 'python
setup.py install' which put the qxdemo package in site-packages next to
the quixote package. (Also, the sample tree appears to have been
properly pickled by manually running the supplied script.) For some
reason, I cannot get even the first page to display; I consistently get
the following error no matter how I arrange the _q_exports list and
'from qxdemo import links' or 'from qxdemo.ui import links' in the
files:

'''
Page not found: /qxdemo/:  has no _q_exports list
'''

I'm pretty sure the driver qxdemo.cgi file is fine since I just copied
it from the working demo.cgi file and changed the Publisher to:

'''
# Create a Publisher instance
app = Publisher('qxdemo.ui') # I also tried Publisher('qxdemo') to no
avail
'''

So I think the problem is the arrangement of _q_exports and import
statments in the __init__.py files. Here's my naive guess at what it
should be:

qxdemo/__init__.py --->  '''_q_exports = ['links']
                          from qxdemo import links''' # entire file

qxdemo/links.py --->  class definitions file (no quixote exports)

qxdemo/ui/__init__.py ---> '''_q_export = ['links']
                            from qxdemo.ui import links''' # entire file

qxdemo/ui/links.ptl ---> '''from qxdemo import links
                          _q_exports = ['_q_index', 'edit', 'book',
'keywords']'''

This arrangement, however, doesn't work. Can someone suggest what the
proper arrangement of imports and exports is (and the Publisher
instance: 'qxdemo' or 'qxdemo/ui'?) so that the initial _q_index method
can be found? Many thanks for any assistance anyone may offer. I'm keen
to get this demo running so that I can start learning quixote
publishing.

John Miller



reply