Running CherryPy 3.0.0beta2 on Python 2.4.3 on Windows XP.
Created following "hello" package in sys.path:
D:devpythonhello> cat __init__.py
import cherrypy
class HelloWorld:
cherrypy.expose
def index(self):
return "Hello world!"
cherrypy.tree.mount(HelloWorld())
cherrypy.server.quickstart()
cherrypy.engine.start()
D:devpythonhello> ls -l
drwx------+ 2 0 Nov 2 12:21 .
d---------+ 6 0 Nov 2 10:28 ..
-rwx------ 1 278 Nov 2 12:21 __init__.py
-rwx------ 1 211 Nov 2 12:21 __init__.pyc
It runs fine executed as a module:
D:devpythonhello> python __init__.py
[02/Nov/2006:12:56:32] HTTP Serving HTTP on http://localhost:8080/
127.0.0.1 - - [02/Nov/2006:12:56:37] "GET /favicon.ico
HTTP/1.1" 404
1200 "" "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.0.7)
Gecko/200609
09 Firefox/1.5.0.7"
127.0.0.1 - - [02/Nov/2006:12:56:39] "GET /
HTTP/1.1" 200 12 ""
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.7)
Gecko/20060909 Firefox/1.
5.0.7"
[02/Nov/2006:12:56:45] ENGINE <Ctrl-C> hit: shutting
down app engine
[02/Nov/2006:12:56:50] HTTP HTTP Server shut down
[02/Nov/2006:12:56:50] ENGINE CherryPy shut down
But running as a package (D:devpython is in sys.path)
there is no
response on 8080 and Ctrl-C causes console window to lockup
while
shutting down app engine:
D:devpythonhello> python -c "import hello"
[02/Nov/2006:12:58:13] HTTP Serving HTTP on http://localhost:8080/
[02/Nov/2006:12:58:56] ENGINE <Ctrl-C> hit: shutting
down app engine
Are there any caveats to package structuring a CherryPy app?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at ht
tp://groups-beta.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|