[ctypes-commit] ctypes/sandbox/tools/codegen h2xml.py,1.4,1.5
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-01-10 16:24:38
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24338 Modified Files: h2xml.py Log Message: Isolate windows specific code. Index: h2xml.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/h2xml.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** h2xml.py 10 Jan 2005 16:16:52 -0000 1.4 --- h2xml.py 10 Jan 2005 16:24:29 -0000 1.5 *************** *** 1,20 **** """h2xml - convert C include file(s) into an xml file by running gccxml.""" import sys, os, tempfile - import _winreg ! def _locate_gccxml(): ! for subkey in (r"Software\gccxml", r"Software\Kitware\GCC_XML"): ! for root in (_winreg.HKEY_CURRENT_USER, _winreg.HKEY_LOCAL_MACHINE): ! try: ! hkey = _winreg.OpenKey(root, subkey, 0, _winreg.KEY_READ) ! except WindowsError, detail: ! if detail.errno != 2: ! raise ! else: ! return _winreg.QueryValueEx(hkey, "loc")[0] + r"\bin" ! loc = _locate_gccxml() ! if loc: ! os.environ["PATH"] = loc ################################################################ --- 1,22 ---- """h2xml - convert C include file(s) into an xml file by running gccxml.""" import sys, os, tempfile ! if sys.platform == "win32": ! def _locate_gccxml(): ! import _winreg ! for subkey in (r"Software\gccxml", r"Software\Kitware\GCC_XML"): ! for root in (_winreg.HKEY_CURRENT_USER, _winreg.HKEY_LOCAL_MACHINE): ! try: ! hkey = _winreg.OpenKey(root, subkey, 0, _winreg.KEY_READ) ! except WindowsError, detail: ! if detail.errno != 2: ! raise ! else: ! return _winreg.QueryValueEx(hkey, "loc")[0] + r"\bin" ! ! loc = _locate_gccxml() ! if loc: ! os.environ["PATH"] = loc ################################################################ |