home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2431 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  1.7 KB  |  73 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4.  
  5. def __boot():
  6.     import sys
  7.     import imp
  8.     import os
  9.     import os.path as os
  10.     PYTHONPATH = os.environ.get('PYTHONPATH')
  11.     if (PYTHONPATH is None or sys.platform == 'win32') and not PYTHONPATH:
  12.         PYTHONPATH = []
  13.     else:
  14.         PYTHONPATH = PYTHONPATH.split(os.pathsep)
  15.     pic = getattr(sys, 'path_importer_cache', { })
  16.     stdpath = sys.path[len(PYTHONPATH):]
  17.     mydir = os.path.dirname(__file__)
  18.     for item in stdpath:
  19.         if item == mydir or not item:
  20.             continue
  21.         
  22.         importer = pic.get(item)
  23.         if importer is not None:
  24.             loader = importer.find_module('site')
  25.             if loader is not None:
  26.                 loader.load_module('site')
  27.                 break
  28.             
  29.         loader is not None
  30.         
  31.         try:
  32.             (stream, path, descr) = imp.find_module('site', [
  33.                 item])
  34.         except ImportError:
  35.             continue
  36.  
  37.         if stream is None:
  38.             continue
  39.         
  40.         
  41.         try:
  42.             imp.load_module('site', stream, path, descr)
  43.         finally:
  44.             stream.close()
  45.  
  46.     else:
  47.         raise ImportError("Couldn't find the real 'site' module")
  48.     known_paths = []([ (makepath(item)[1], 1) for item in sys.path ])
  49.     oldpos = getattr(sys, '__egginsert', 0)
  50.     sys.__egginsert = 0
  51.     for item in PYTHONPATH:
  52.         addsitedir(item)
  53.     
  54.     sys.__egginsert += oldpos
  55.     (d, nd) = makepath(stdpath[0])
  56.     insert_at = None
  57.     new_path = []
  58.     for item in sys.path:
  59.         (p, np) = makepath(item)
  60.         if np in known_paths or insert_at is None:
  61.             new_path.append(item)
  62.             continue
  63.         None if np == nd and insert_at is None else []
  64.         new_path.insert(insert_at, item)
  65.         insert_at += 1
  66.     
  67.     sys.path[:] = new_path
  68.  
  69. if __name__ == 'site':
  70.     __boot()
  71.     del __boot
  72.  
  73.