Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(33)  |  Call(0)  |  Derive(30)  |  Import(3)

src/m/o/mozpool-4.1.5/mozpool/mozpool/handlers.py   mozpool(Download)
from mozpool import config
from mozpool.db import exceptions
from mozpool.web.handlers import Handler, requestredirect, nocontent, ConflictJSON
 
urls = (
class device_list(Handler):
    @templeton.handlers.json_response
    def GET(self):
        args, _ = templeton.handlers.get_request_parms()
        return {'devices': self.db.devices.list(detail='details' in args)}
 
class device_request(Handler):
class request_list(Handler):
    @templeton.handlers.json_response
    def GET(self):
        args, _ = templeton.handlers.get_request_parms()
        include_closed = args.get('include_closed', False)
        return dict(requests=self.db.requests.list(include_closed=include_closed))
 
class request_details(Handler):

src/m/o/mozpool-4.1.5/mozpool/bmm/handlers.py   mozpool(Download)
import web
import templeton
from mozpool.web.handlers import deviceredirect, relayredirect, Handler
from mozpool.bmm import api
 
class test_two_way_comms(Handler):
    @relayredirect
    @templeton.handlers.json_response
    def GET(self, relay_name):
        a = api.API(self.db)
        # starts a comm check and return the results
        return { 'success' : a.test_two_way_comms.run(relay_name)}
 
class power_cycle(Handler):
class power_off(Handler):
    @deviceredirect
    @templeton.handlers.json_response
    def GET(self, device_name):
        # start the power off and ignore the result
        a = api.API(self.db)
        a.poweroff.start(lambda res : None, device_name)
        return {}
 
class ping(Handler):

src/m/o/mozpool-4.1.5/mozpool/lifeguard/handlers.py   mozpool(Download)
import time
import mozpool.lifeguard
from mozpool.web.handlers import deviceredirect, InMemCacheMixin, Handler
 
# URLs go here. "/api/" will be automatically prepended to each.
class state_change(Handler):
    @deviceredirect
    @templeton.handlers.json_response
    def POST(self, device_name, from_state, to_state):
        success = mozpool.lifeguard.driver.conditional_state_change(
class device_event(Handler):
    @deviceredirect
    @templeton.handlers.json_response
    def POST(self, device_name, event):
        args, body = templeton.handlers.get_request_parms()
class device_status(Handler):
    @templeton.handlers.json_response
    def GET(self, device_name):
        state = self.db.devices.get_machine_state(device_name)
        logs = self.db.devices.get_logs(device_name, limit=100)
        return {'state': state, 'log': logs}
 
class device_state(Handler, InMemCacheMixin):

src/m/o/mozpool-4.1.5/mozpool/test/unit/web/test_handlers.py   mozpool(Download)
class DevTestHandler(handlers.Handler):
 
    @handlers.deviceredirect
    def GET(self, device_name):
        web.header('Content-Type', 'text/plain')
        return "hi"
 
 
class ReqTestHandler(handlers.Handler):
class RelayTestHandler(handlers.Handler):
 
    @handlers.relayredirect
    def GET(self, request_id):
        web.header('Content-Type', 'text/plain')
        return "hi"
 
 
class CachedHandler(handlers.InMemCacheMixin, handlers.Handler):