[ctypes-commit] ctypes/sandbox/tools inc2py.py,1.5,1.6
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-09-03 14:38:21
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29202 Modified Files: inc2py.py Log Message: Add a sample command line. Fix a problem where unparsed lines were missing in the error output. Index: inc2py.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/inc2py.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** inc2py.py 3 Sep 2004 12:16:02 -0000 1.5 --- inc2py.py 3 Sep 2004 14:38:12 -0000 1.6 *************** *** 67,70 **** --- 67,74 ---- program is doing, verbosity 2 additionally prints lines it could not parse. + + For a start (on windows), try this: + + inc2py.py -D _WIN32_WINNT=0x500 -c msvc71 -o windows.py windows.h """ *************** *** 196,199 **** --- 200,204 ---- os.remove(c_file) + ################################################################ class IncludeParser(object): *************** *** 216,221 **** def parse(self, *files): ! self._parse(*files) self._env.pop("__builtins__", None) def _parse(self, *files): --- 221,230 ---- def parse(self, *files): ! remaining = self._parse(*files) self._env.pop("__builtins__", None) + # self._errlines are lines we do not know how to handle, and + # self.lines are the remaining lines where we know how to + # handle them but fail. + self._errlines = self._errlines + remaining def _parse(self, *files): *************** *** 240,243 **** --- 249,253 ---- print >> sys.stderr, "Parsing done." + return lines def create_statement(self, line): *************** *** 267,271 **** try: exec stmt in self._env ! except: pass else: --- 277,281 ---- try: exec stmt in self._env ! except Exception: pass else: |