Ejemplo n.º 1
0
 def decorator(callback):
     if isinstance(callback, str): callback = load(callback)
     for rule in makelist(path) or yieldroutes(callback):
         for verb in makelist(method):
             verb = verb.upper()
             route = Route(self, rule, verb, callback,
                           name=name,
                           plugins=plugins,
                           skiplist=skiplist, **config)
             self.add_route(route)
     return callback
Ejemplo n.º 2
0
import pin
import control
import time

pin.load("config1.json")
control.load("config1.json")

control.move(80, 60)
time.sleep(3)
control.move(-100, 90)
time.sleep(3)

# reset the GPIOs
pin.cleanup()
Ejemplo n.º 3
0
 def decorator(callback):
     if isinstance(callback, str): callback = load(callback)
     self.error_handler[int(code)] = callback
     return callback