Normalize space/tabs indentation for Python 3.0

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1339 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2009-04-06 20:37:52 +00:00
parent 2d4a04fb10
commit 732303ed4e
1 changed files with 26 additions and 26 deletions

View File

@ -56,14 +56,14 @@ class ScriptAdapter :
# @param policy A user-implemented class inheriting from Policy.Policy
def __init__(self, policy):
self._policy = policy()
print 'ScriptAdapter for policy ', policy, ' loaded'
print ('ScriptAdapter for policy ', policy, ' loaded')
## @brief Asynchronously call Policy.configure()
#
# @param self The caller object
def async_configure(self):
self._g_last_exception = None
self._g_mutex.lock(ScriptAdapter._wrap_configure, self )
self._g_mutex.lock(ScriptAdapter._wrap_configure, self )
def _wrap_configure(self):
thread.start_new_thread(ScriptAdapter._wrap_configure_callback, (self,))
@ -71,10 +71,10 @@ class ScriptAdapter :
def _wrap_configure_callback(self):
# call configure method
try:
self._policy.configure()
except:
self._g_last_exception = sys.exc_value
self._g_mutex.unlock()
self._policy.configure()
except:
self._g_last_exception = sys.exc_value
self._g_mutex.unlock()
## @brief Asynchronously call Policy.sort_queue()
@ -94,13 +94,13 @@ class ScriptAdapter :
# here we retrieve and pass the ready queue
queue = sgpem.Scheduler.get_instance().get_ready_queue()
try:
self._policy.sort_queue(queue)
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
try:
self._policy.sort_queue(queue)
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
self._g_mutex.unlock()
@ -116,12 +116,12 @@ class ScriptAdapter :
def _wrap_is_preemptive_callback(self):
try:
self._ret_val = self._policy.is_preemptive()
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
self._ret_val = self._policy.is_preemptive()
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
self._g_mutex.unlock()
## @brief Asynchronously call Policy.get_time_slice()
@ -136,12 +136,12 @@ class ScriptAdapter :
def _wrap_get_time_slice_callback(self):
try:
self._ret_val = self._policy.get_time_slice()
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
self._ret_val = self._policy.get_time_slice()
except:
# exception raised in user-defined method,
# save it so the C++ code can tell the
# user what went wrong
self._g_last_exception = sys.exc_value
self._g_mutex.unlock()
## @brief Return the global shared variable with the methods' last return value
@ -152,5 +152,5 @@ class ScriptAdapter :
return self._g_mutex.test()
def get_last_exception(self):
return self._g_last_exception
return self._g_last_exception