Commit bacdb574 by vagrant

Added ability to toggle binary flags through the python calls

parent 62e9caa1
...@@ -665,19 +665,23 @@ class Modules(object): ...@@ -665,19 +665,23 @@ class Modules(object):
def __exit__(self, t, v, b): def __exit__(self, t, v, b):
self.cleanup() self.cleanup()
def _set_arguments(self, argv=[], kargv={}): def _set_arguments(self, argv=None, kargv=None):
for (k, v) in iterator(kargv): if kargv:
k = self._parse_api_opt(k) for (k, v) in iterator(kargv):
if v not in [True, False, None]: k = self._parse_api_opt(k)
if not isinstance(v, list): if v not in [True, False, None]:
v = [v] if not isinstance(v, list):
for value in v: v = [v]
if not isinstance(value, str): for value in v:
value = str(bytes2str(value)) if not isinstance(value, str):
argv.append(k) value = str(bytes2str(value))
argv.append(value) argv.append(k)
else: argv.append(value)
argv.append(k) else:
# Only append if the value is True; this allows for toggling values
# by the function call.
if v:
argv.append(k)
if not argv and not self.arguments: if not argv and not self.arguments:
self.arguments = sys.argv[1:] self.arguments = sys.argv[1:]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment