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