home *** CD-ROM | disk | FTP | other *** search
/ Freelog 116 / FreelogNo116-JuilletSeptembre2013.iso / Bureautique / gImageReader / gimagereader_0.9-1_win32.exe / bin / win32com / __init__.pyc (.txt)
Python Compiled Bytecode  |  2011-03-24  |  2KB  |  97 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. import win32api
  5. import sys
  6. import os
  7. import pythoncom
  8. _frozen = getattr(sys, 'frozen', 1 == 0)
  9. if _frozen and not getattr(pythoncom, 'frozen', 0):
  10.     pythoncom.frozen = sys.frozen
  11. __gen_path__ = ''
  12. __build_path__ = None
  13.  
  14. def SetupEnvironment():
  15.     global __build_path__, __gen_path__
  16.     HKEY_LOCAL_MACHINE = -2147483646
  17.     KEY_QUERY_VALUE = 1
  18.     
  19.     try:
  20.         keyName = 'SOFTWARE\\Python\\PythonCore\\%s\\PythonPath\\win32com' % sys.winver
  21.         key = win32api.RegOpenKey(HKEY_LOCAL_MACHINE, keyName, 0, KEY_QUERY_VALUE)
  22.     except (win32api.error, AttributeError):
  23.         key = None
  24.  
  25.     
  26.     try:
  27.         found = 0
  28.         if key is not None:
  29.             
  30.             try:
  31.                 __path__.append(win32api.RegQueryValue(key, 'Extensions'))
  32.                 found = 1
  33.             except win32api.error:
  34.                 pass
  35.             
  36.  
  37.         if not found:
  38.             
  39.             try:
  40.                 __path__.append(win32api.GetFullPathName(__path__[0] + '\\..\\win32comext'))
  41.             except win32api.error:
  42.                 pass
  43.             
  44.  
  45.         
  46.         try:
  47.             if key is not None:
  48.                 __build_path__ = win32api.RegQueryValue(key, 'BuildPath')
  49.                 __path__.append(__build_path__)
  50.         except win32api.error:
  51.             pass
  52.  
  53.         if key is not None:
  54.             
  55.             try:
  56.                 __gen_path__ = win32api.RegQueryValue(key, 'GenPath')
  57.             except win32api.error:
  58.                 pass
  59.             
  60.  
  61.     finally:
  62.         if key is not None:
  63.             key.Close()
  64.  
  65.  
  66.  
  67. def __PackageSupportBuildPath__(package_path):
  68.     if not _frozen and __build_path__:
  69.         package_path.append(__build_path__)
  70.  
  71. if not _frozen:
  72.     SetupEnvironment()
  73. if not __gen_path__:
  74.     
  75.     try:
  76.         import win32com.gen_py as win32com
  77.         __gen_path__ = sys.modules['win32com.gen_py'].__path__[0]
  78.     except ImportError:
  79.         __gen_path__ = os.path.abspath(os.path.join(__path__[0], 'gen_py'))
  80.         if not os.path.isdir(__gen_path__):
  81.             __gen_path__ = os.path.join(win32api.GetTempPath(), 'gen_py', '%d.%d' % (sys.version_info[0], sys.version_info[1]))
  82.         
  83.     
  84.  
  85. if 'win32com.gen_py' not in sys.modules:
  86.     import imp
  87.     gen_py = imp.new_module('win32com.gen_py')
  88.     gen_py.__path__ = [
  89.         __gen_path__]
  90.     sys.modules[gen_py.__name__] = gen_py
  91.     del imp
  92. gen_py = sys.modules['win32com.gen_py']
  93. del os
  94. del sys
  95. del win32api
  96. del pythoncom
  97.