props = None
props_filename = PROPS_FILENAME
-droneController = None
+drone_controller = None
def usage():
print '''
def onThreadsComplete(scriptManager):
- global droneController
+ global drone_controller
#summary = ScriptThread.current_script_thread().dbConnection.createTaskSummary()
- #droneController.sendResult(type='task_summary', **summary)
+ #drone_controller.sendResult(type='task_summary', **summary)
read_args_and_props()
init_dirs()
accept commands from the controller module, perform
the action, then go back to listening '''
- droneController = DroneController(
+ drone_controller = DroneController(
props.get_property('constrictor.address'),
int(props.get_property('constrictor.port')))
while True:
try:
- command = droneController.recv()['command']
+ command = drone_controller.recv()['command']
if command['action'] == 'setprop':
prop = str(command['prop'])
exec(f)
except Exception, e:
log_error("script execution failed: %s" % str(e))
- droneController.sendError(text=str(e))
+ drone_controller.sendError(text=str(e))
f.close()
continue
except KeyboardInterrupt:
- droneController.shutdown()
+ drone_controller.shutdown()
else:
init_db()