*types.ModuleType
This commit is contained in:
parent
f90b1b84fe
commit
f0972fc1f8
10
srcxray.py
10
srcxray.py
|
@ -929,14 +929,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
a1 = sys.argv[1]
|
a1 = sys.argv[1]
|
||||||
sys.argv = sys.argv[1:]
|
sys.argv = sys.argv[1:]
|
||||||
if isinstance(eval(a1), types.ModuleType):
|
if '(' in a1:
|
||||||
ret = eval(a1+".main()")
|
|
||||||
elif '(' in a1:
|
|
||||||
ret = eval(a1)
|
ret = eval(a1)
|
||||||
# ret = exec(sys.argv[1])
|
# ret = exec(sys.argv[1])
|
||||||
|
elif len(sys.argv) == 1 and isinstance(eval(a1), types.ModuleType):
|
||||||
|
ret = eval(a1 + ".main()")
|
||||||
else:
|
else:
|
||||||
ret = eval(a1 + '(' + ', '.join("'%s'" % (a1)
|
ret = eval(a1 + '(' + ', '.join("'%s'" % (a)
|
||||||
for a1 in sys.argv[1:]) + ')')
|
for a in sys.argv[1:]) + ')')
|
||||||
if isinstance(ret, nx.DiGraph):
|
if isinstance(ret, nx.DiGraph):
|
||||||
digraph_print(ret)
|
digraph_print(ret)
|
||||||
if isinstance(ret, bool) and ret is False:
|
if isinstance(ret, bool) and ret is False:
|
||||||
|
|
Loading…
Reference in New Issue