def requeue(self): if cherrypy.request.method != 'POST': raise Exception("Must invoke this method using POST") from firehose.jobs.master import MasterPoller master = MasterPoller.get() master.requeue() return {}
def taskset_status(self): if cherrypy.request.method != 'POST': raise Exception("Must invoke this method using POST") from firehose.jobs.master import MasterPoller master = MasterPoller.get() status = simplejson.load(cherrypy.request.body) master.taskset_status(status) return {}
def addfeed(self, feedurl=None): if cherrypy.request.method != 'POST': raise Exception("Must invoke this method using POST") if feedurl is None: _logger.debug("no feed url specified") return {} from firehose.jobs.master import MasterPoller master = MasterPoller.get() master.add_feed(feedurl) return {}
from turbogears import config, update_config, start_server import cherrypy cherrypy.lowercase_api = True from os.path import * import sys # first look on the command line for a desired config file, # if it's not on the command line, then # look for setup.py in this directory. If it's not there, this script is # probably installed if len(sys.argv) > 1: update_config(configfile=sys.argv[1], modulename="firehose.config") elif exists(join(dirname(__file__), "setup.py")): update_config(configfile="dev.cfg",modulename="firehose.config") else: update_config(configfile="prod.cfg",modulename="firehose.config") config.update(dict(package="firehose")) import firehose.jobs.master from firehose.jobs.master import MasterPoller import logging l = logging.getLogger('firehose.Startup') l.debug("Startup!") master = MasterPoller.get() master.start() from firehose.controllers import Root start_server(Root())