Added verbose messages.

This commit is contained in:
Paul Müller 2015-01-06 12:52:46 +01:00
parent 5a4a3c0798
commit 62036022b4

View file

@ -691,6 +691,7 @@ class JobManager_Server(object):
print("{}: wait {}s before trigger clean up".format(self._identifier, self.__wait_before_stop)) print("{}: wait {}s before trigger clean up".format(self._identifier, self.__wait_before_stop))
time.sleep(self.__wait_before_stop) time.sleep(self.__wait_before_stop)
class JobManager_Client(object): class JobManager_Client(object):
""" """
Calls the functions self.func with arguments fetched from the job_q. You should Calls the functions self.func with arguments fetched from the job_q. You should
@ -902,13 +903,14 @@ class JobManager_Client(object):
#args_of_func = inspect.getfullargspec(func).args #args_of_func = inspect.getfullargspec(func).args
#if len(args_of_func) == 2: #if len(args_of_func) == 2:
count_args = getCountKwargs(func) count_args = getCountKwargs(func)
print(count_args)
if count_args is None: if count_args is None:
if verbose > 1: if verbose > 1:
print("{}: found function without status information".format(identifier)) print("{}: found function without status information".format(identifier))
m.value = 0 # setting max_count to -1 will hide the progress bar m.value = 0 # setting max_count to -1 will hide the progress bar
_func = lambda arg, const_arg, c, m : func(arg, const_arg) _func = lambda arg, const_arg, c, m : func(arg, const_arg)
elif count_args != ["c", "m"]: elif count_args != ["c", "m"]:
if verbose > 1:
print("{}: found counter keyword arguments: {}".format(identifier, count_args))
# Allow other arguments, such as ["jmc", "jmm"] as defined # Allow other arguments, such as ["jmc", "jmm"] as defined
# in `validCountKwargs`. # in `validCountKwargs`.
# Here we translate to "c" and "m". # Here we translate to "c" and "m".
@ -916,6 +918,8 @@ class JobManager_Client(object):
arg[count_args[0]] = c arg[count_args[0]] = c
arg[count_args[1]] = m arg[count_args[1]] = m
else: else:
if verbose > 1:
print("{}: found standard keyword arguments: [c, m]".format(identifier))
_func = func _func = func