Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim McNamara <code@timmcnamara.co.nz>2010-08-14 23:26:48 (GMT)
committer Tim McNamara <code@timmcnamara.co.nz>2010-08-14 23:26:48 (GMT)
commit9a5fdf65b7b2932f7b581ac60c6767c0b15e645a (patch)
treec783a7f18db2f31212073e444e71490e158c5b51
parent0de7b6932380d360e8ba55eaf87f2ac04cdd02a3 (diff)
Removed right-hand whitespace
Removed trailing whitespace.
-rwxr-xr-xExperior.Activity/sbexecutionengine.py154
1 files changed, 77 insertions, 77 deletions
diff --git a/Experior.Activity/sbexecutionengine.py b/Experior.Activity/sbexecutionengine.py
index 228f0e1..cb0b361 100755
--- a/Experior.Activity/sbexecutionengine.py
+++ b/Experior.Activity/sbexecutionengine.py
@@ -33,80 +33,80 @@ import gtk
from sbpython import *
class sbExecutionEngine:
- """
- Responsible for communications with the XML-RPC server regarding command
- retrieval, as well as parsing and execution of those commands.
- """
- def __init__(self, sbGUI, xmlRpcServer):
- self.sbgui = sbGUI
- self.rpc = xmlRpcServer
- self.widgets = sbwidgets
-
- self.delayedExecution = False
- self.executionComplete = False
- self.lastCommand = None
-
- self.log = logging.getLogger("ExecutionEngine")
-
- try:
- self.id = os.environ['SUGARBOT_ID']
- except KeyError:
- self.log.error("Sugarbot ID is not set. Using default 0. ")
- self.id = 0
-
- def killSugarbot(self):
- """
- Kills the sugarbot activity.
- """
- self.log.info("Attempting to kill sugarbot")
- sys.exit(0)
-
- def executePy(self):
- """
- Executes the Sugarbot p◊ython script.
-
- Executes the Sugarbot python script provided by the XML-RPC server.
- Regards any unhandled exceptions as fatal errors, and reports them
- to the server. Also handles the termination of Sugarbot if the
- auto-restart flag has been set by the XML-RPC server.
- """
- self.script = self.rpc.getScript(self.id)
- self.log.info("Executing Script:\n%s" % self.script)
-
- self.widgets.gui = self.sbgui
-
- # Execute the actual python script.
- try:
- exec self.script
-
- # t = threading.Thread(args=(self.widgets,))
- # t.run = sugarbot_main
- # t.start()
-
- sugarbot_main(self.widgets)
- self.rpc.success(self.id)
-
- # Something bad happened. Report it, and log it.
- except:
- text = "Execution failed:\n%s" % traceback.format_exc()
- text = self.rpc.fail(text, self.id)
- self.log.error( text )
-
- # Regarless of the success status, check to see if we need to restart
- # sugarbot or not.
- finally:
- restart = self.rpc.getRestartFlag()
- self.log.info("Got restart flag: " + str(restart))
-
- if restart:
- self.killSugarbot()
-
-
- def isComplete(self):
- """
- Returns true if execution is complete.
-
- Returns true if execution is complete, i.e. there are no more
- commands that can be executed.
- """
- return self.executionComplete
+ """
+ Responsible for communications with the XML-RPC server regarding command
+ retrieval, as well as parsing and execution of those commands.
+ """
+ def __init__(self, sbGUI, xmlRpcServer):
+ self.sbgui = sbGUI
+ self.rpc = xmlRpcServer
+ self.widgets = sbwidgets
+
+ self.delayedExecution = False
+ self.executionComplete = False
+ self.lastCommand = None
+
+ self.log = logging.getLogger("ExecutionEngine")
+
+ try:
+ self.id = os.environ['SUGARBOT_ID']
+ except KeyError:
+ self.log.error("Sugarbot ID is not set. Using default 0. ")
+ self.id = 0
+
+ def killSugarbot(self):
+ """
+ Kills the sugarbot activity.
+ """
+ self.log.info("Attempting to kill sugarbot")
+ sys.exit(0)
+
+ def executePy(self):
+ """
+ Executes the Sugarbot p◊ython script.
+
+ Executes the Sugarbot python script provided by the XML-RPC server.
+ Regards any unhandled exceptions as fatal errors, and reports them
+ to the server. Also handles the termination of Sugarbot if the
+ auto-restart flag has been set by the XML-RPC server.
+ """
+ self.script = self.rpc.getScript(self.id)
+ self.log.info("Executing Script:\n%s" % self.script)
+
+ self.widgets.gui = self.sbgui
+
+ # Execute the actual python script.
+ try:
+ exec self.script
+
+ # t = threading.Thread(args=(self.widgets,))
+ # t.run = sugarbot_main
+ # t.start()
+
+ sugarbot_main(self.widgets)
+ self.rpc.success(self.id)
+
+ # Something bad happened. Report it, and log it.
+ except:
+ text = "Execution failed:\n%s" % traceback.format_exc()
+ text = self.rpc.fail(text, self.id)
+ self.log.error( text )
+
+ # Regarless of the success status, check to see if we need to restart
+ # sugarbot or not.
+ finally:
+ restart = self.rpc.getRestartFlag()
+ self.log.info("Got restart flag: " + str(restart))
+
+ if restart:
+ self.killSugarbot()
+
+
+ def isComplete(self):
+ """
+ Returns true if execution is complete.
+
+ Returns true if execution is complete, i.e. there are no more
+ commands that can be executed.
+ """
+ return self.executionComplete