MCPcopy Create free account
hub / github.com/numpy/numpy / parse_cmd

Function parse_cmd

numpy/distutils/lib2def.py:38–60  ·  view source on GitHub ↗

Parses the command-line arguments. libfile, deffile = parse_cmd()

()

Source from the content-addressed store, hash-verified

36DATA_RE = re.compile(r"^_imp__(.*) in python%s\.dll" % py_ver, re.MULTILINE)
37
38def parse_cmd():
39 """Parses the command-line arguments.
40
41libfile, deffile = parse_cmd()"""
42 if len(sys.argv) == 3:
43 if sys.argv[1][-4:] == '.lib' and sys.argv[2][-4:] == '.def':
44 libfile, deffile = sys.argv[1:]
45 elif sys.argv[1][-4:] == '.def' and sys.argv[2][-4:] == '.lib':
46 deffile, libfile = sys.argv[1:]
47 else:
48 print("I'm assuming that your first argument is the library")
49 print("and the second is the DEF file.")
50 elif len(sys.argv) == 2:
51 if sys.argv[1][-4:] == '.def':
52 deffile = sys.argv[1]
53 libfile = 'python%s.lib' % py_ver
54 elif sys.argv[1][-4:] == '.lib':
55 deffile = None
56 libfile = sys.argv[1]
57 else:
58 libfile = 'python%s.lib' % py_ver
59 deffile = None
60 return libfile, deffile
61
62def getnm(nm_cmd=['nm', '-Cs', 'python%s.lib' % py_ver], shell=True):
63 """Returns the output of nm_cmd via a pipe.

Callers 1

lib2def.pyFile · 0.85

Calls 1

printFunction · 0.85

Tested by

no test coverage detected