

@deferredGenerator
def sendCommand(self, command, keyObj, **kwargs):
    "default method is a short circuit to the server's action handler"
    result = None
    try:
        services = sys.modules.get('services')
        drone = services.drone.drone
        args = command.split()
        action = drone.get_action(args.pop(0))
        if args:
            args = ' '.join(args)
        else:
            args = ''
        d = maybeDeferred(action, args)
        d.addBoth(drone.formatResults)
        wfd = waitForDeferred(d)
        (yield wfd)
        result = {
            self.server: wfd.getResult(),
        }
    except:
        result = Failure()
    (yield result)

dataset/ETHPy150Open OrbitzWorldwide/droned/droned/lib/droned/models/droneserver.py DroneD.sendCommand/original