From: erickson Date: Thu, 8 Apr 2010 18:04:11 +0000 (+0000) Subject: python style tweaks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b481df1e4a23a4c9ba45ff2882396fca6fe30017;p=working%2Frandom.git python style tweaks git-svn-id: svn://svn.open-ils.org/ILS-Contrib/constrictor/trunk@858 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/constrictor.py b/constrictor.py index 39c54f381..6ad12604e 100755 --- a/constrictor.py +++ b/constrictor.py @@ -24,7 +24,7 @@ import constrictor.data props = None props_filename = PROPS_FILENAME -droneController = None +drone_controller = None def usage(): print ''' @@ -85,9 +85,9 @@ def read_args_and_props(): 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() @@ -102,7 +102,7 @@ if props.get_property('constrictor.listen') == 'true': 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'))) @@ -110,7 +110,7 @@ if props.get_property('constrictor.listen') == 'true': while True: try: - command = droneController.recv()['command'] + command = drone_controller.recv()['command'] if command['action'] == 'setprop': prop = str(command['prop']) @@ -135,12 +135,12 @@ if props.get_property('constrictor.listen') == 'true': 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()