r6 - 28 Apr 2006 - 11:37:38 - AlecFlettYou are here: OSAF >  Projects Web  > ChandlerParcels

Chandler Parcels


Morgen Sagen

Web-servlet parcels:

  • /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)

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:

Screenshot of pyshellblock in action:


Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r6 < r5 < r4 < r3 < r2 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.