please help!  I'd like to also release the photo gallery and CMS I'm
working on, but only if they can be self-contained easy-to-install
products.  Any tips?  Should I ask more specific questions?

one way will be to transform your project into a turbogears extension.
check out the recently released turbomail. Also the identity module is
written that way.

TurboMail is a simple TG extension which, at its core, creates a new thread during TurboGears startup, and shuts the thread down during TurboGears shutdown.  Not really a package that adds anything to your TG project.

The CMS I'm working on (and unfortunately can not release as of yet) is very similar to TurboMail, but also attaches itself to your root controller (cherrypy.root).  During TG startup, my CMS also attaches the CMS static directory by amending the site configuration at runtime.  It uses similar code to the following:

def start_extension():
# Bail out if the application hasn't enabled this extension
if not cherrypy.config.get("EXTENSION-NAME.on", False):
return
log.info("EXTENSION starting")
cherrypy.config.update({"/xtn_static" :
{
"static_filter.on" : True,
"static_filter.dir" :
os.path.abspath(pkg_resources.resource_filename(__name__, "static")),
'log_debug_info_filter.on' : False,
}
})
cherrypy.root.XTN = XTN.controllers.Main()

def shutdown_extension():
# Bail out if the application hasn't enabled this extension
if not cherrypy.config.get("EXTENSION-NAME.on", False):
return
log.info("EXTENSION shutting down")
pass

I'm not sure how well this works with the latest TG - cherrypy.config has become turbogears.config, and the cherrypy.root = controllers.Root() line from start-appname.py has been removed.  Is cherrypy.root still configured?

Have a gander at the setup.py script for TurboGears (or the entry-points file in the EGG-INFO directory), and the turbogears/identity/visit.py file, which contains the above two functions as well.  You'll need to add to your project's setup.py something like the following: (from TurboMail)

setup(
...,
entry_points = {'turbogears.extensions': ["turbomail = turbomail"]}
)

Good luck!

Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to