Hi Thomas, hi all,
I found a problem with setup.py - I can't pass long flags (i.e. -with_doc). The
setup program tries to interpret this as a string of short flags (-w -i -t...)
and doesn't know what to do with them. Changing to --with_doc (2x -) fixes. I've
attached a patch to cure this. It also changes a reference from CeCILL to GPL,
and adds a warning if you try to specify --with_doc without also setting
--generate_swig.
Cheers,
Arthur
--- setup.py 2009-04-02 10:23:42.000000000 +0200
+++ setup.py.new 2009-04-02 10:31:29.000000000 +0200
@@ -27,31 +27,34 @@
init_time = time.time()
print "Building pythonOCC"
# Check whether generate swig .i files
-if '-generate_swig' in sys.argv:
+if '--generate_swig' in sys.argv:
GENERATE_SWIG = True
- sys.argv.remove('-generate_swig')
+ sys.argv.remove('--generate_swig')
else:
GENERATE_SWIG = False
# Check whether generate docstrings
-if ('-with_doc' in sys.argv) and GENERATE_SWIG:
+if ('--with_doc' in sys.argv):
+ if not GENERATE_SWIG:
+ print "To use --with_doc you must also enable --generate_swig"
+ sys.exit(0)
GENERATE_DOC = True
- sys.argv.remove('-with_doc')
+ sys.argv.remove('--with_doc')
r = raw_input("""IMPORTANT: the generate_doc argument extracts
documentation strings from OCC header files.
- You should not redistribute this package since it could break the
OpenCascade and CeCILL licenses.
+ You should not redistribute this package since it could break the
OpenCascade and GPL licenses.
Enter 'Y' or 'y' if you accept this disclaimer and want to continue, 'n'
otherwise.""")
if (r!='Y' and r!='y'):
print "on y est"
sys.exit(0)
else:
GENERATE_DOC = False
-if ('-help' in sys.argv) or ('-h' in sys.argv):
+if ('--help' in sys.argv) or ('-h' in sys.argv):
help_str="""pythonOCC builder system - (c) Thomas Paviot, 2008-2009.
usage: python setup.py build [options]
With [options]:
- -generate_swig: process swig files generation (if .i files already exist,
you should skip this option)
- -modular: build modular
- -with_doc: add docstrings to pythonOCC classes
- -ccompiler: compiler can be either 'gcc', 'mingw32' or 'msvc'
+ --generate_swig: process swig files generation (if .i files already exist,
you should skip this option)
+ --modular: build modular
+ --with_doc: add docstrings to pythonOCC classes
+ --ccompiler: compiler can be either 'gcc', 'mingw32' or 'msvc'
"""
print help_str
sys.exit(0)
@@ -272,4 +275,4 @@
if GENERATE_SWIG:
print "%i exported classes"%SWIG_generator.nb_exported_classes
final_time = time.time()
-print final_time-init_time
\ No newline at end of file
+print final_time-init_time
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users