Chandler Parcels
Morgen Sagen
Web-servlet parcels:
- /hello -- a "hello world" servlet showing a basic implementation
- /inbound -- an RSS/Feed servlet which displays unread FeedItems
- Available via SVN from http://svn.osafoundation.org/sandbox/morgen/parcels/inbound
- You can add Feed Channels either by using the 'Collection menu | New Feed Channel' and entering a URL, or you can put a file named inbound.txt containing a URL per line into your Chandler profile directory; the location of your profile directory is platform-dependent (Linux: ~/.chandler, OS X: ~/Library/Application Support/Open Source Applications Foundation/Chandler, Windows: C:\Documents and Settings[Username]\Application Data\Open Source Applications Foundation\Chandler)
- /books -- an library catalog manager I'm working on for my sister-in-law's preschool
- /recipes -- an recipe manager for sharing recipes with people
- twisted_wsgi -- provides a way to run a WSGI-compliant app inside Chandler's twisted server
import twisted_wsgi
from application import schema
def installParcel(parcel, oldVersion=None):
app = schema.ns('osaf.app', parcel)
twisted_wsgi.Resource.update(parcel, 'demoApp',
displayName='WSGI Demo',
server=app.mainServer,
location='wsgidemo',
resourceClass=schema.importString('twisted_wsgi.WSGIResource'),
application='wsgiref.simple_server.demo_app'
)
I think this is what we need to run
CherryPy? within WSGI:
cherry = twisted_wsgi.Resource.update(parcel, 'cherrypy',
displayName='CherryPy',
server=app.mainServer,
location='cherrypy',
resourceClass=schema.importString('twisted_wsgi.WSGIResource'),
application='cherrypy._cpwsgi.wsgiApp'
)
Then, when running headless do the following:
class HelloWorld:
def index(self):
return "Hello"
index.exposed = True
import cherrypy
cherrypy.config.update({'global': {'server.environment': 'production'}})
cherrypy.root = HelloWorld( )
cherrypy.root.cherrypy = HelloWorld( ) # A hack, I know, but I haven't yet figured out how to tell CherryPy that it's not the owner of the whole URL space on the server
cherrypy.server.start(initOnly=True, serverClass=None)
Non-servlet parcels:
- irc -- turns Chandler into an IRC bot
- uiextension -- creates hooks for adding widgets to bottom and right edges of Chandler
- pyshellblock -- uses uiextension to add a PyShell to the bottom of Chandler
Screenshot of pyshellblock in action: