...
 
Commits (2)
......@@ -212,27 +212,35 @@ class Job(object):
return argument
def set_custom_options(self, use_long=True, silent=True, **kwargs):
def set_custom_options(self, *args, use_long=True, silent=True, **kwargs):
"""Adds custom queueing manager options.
Parameters
----------
use_long : bool
Whether to use long option names which are usually prepended with
"`--`" (Default is ``True``).
"`--`". The key and value pair is then separated by "=".
(Default: ``True``)
silent : bool
Whether to print the custom options to screen.
Other Parameters
----------------
args : tuple
Tuple of additional flags (no key-value-pair).
kwargs : dict
Keywords and their values.
"""
# keyworded arguments
if use_long:
self.custom_options.extend(["{0}={1}".format(k, v) for k, v in
kwargs.items()])
else:
self.custom_options.extend(["{0} {1}".format(k, v) for k, v in
kwargs.items()])
# flags
self.custom_options.extend(args)
if not silent:
print("-- Custom options specified: ", " ".join(self.custom_options))
......