srcanamdw/codescanner/pyinstaller/support/rthooks/win32comgenpy.py
changeset 1 22878952f6e2
equal deleted inserted replaced
0:509e4801c378 1:22878952f6e2
       
     1 # Copyright (C) 2005, Giovanni Bajo
       
     2 # Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
       
     3 #
       
     4 # This program is free software; you can redistribute it and/or
       
     5 # modify it under the terms of the GNU General Public License
       
     6 # as published by the Free Software Foundation; either version 2
       
     7 # of the License, or (at your option) any later version.
       
     8 #
       
     9 # In addition to the permissions in the GNU General Public License, the
       
    10 # authors give you unlimited permission to link or embed the compiled
       
    11 # version of this file into combinations with other programs, and to
       
    12 # distribute those combinations without any restriction coming from the
       
    13 # use of this file. (The General Public License restrictions do apply in
       
    14 # other respects; for example, they cover modification of the file, and
       
    15 # distribution when not linked into a combine executable.)
       
    16 #
       
    17 # This program is distributed in the hope that it will be useful,
       
    18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    20 # GNU General Public License for more details.
       
    21 #
       
    22 # You should have received a copy of the GNU General Public License
       
    23 # along with this program; if not, write to the Free Software
       
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
       
    25 
       
    26 import os, sys
       
    27 supportdir = os.path.join(sys.path[0], 'support')
       
    28 genpydir = os.path.join(supportdir, 'gen_py')
       
    29 initmod = os.path.join(genpydir, '__init__.py')
       
    30 if not os.path.exists(genpydir):
       
    31     os.makedirs(genpydir)
       
    32 if not os.path.exists(initmod):
       
    33     open(initmod, 'w')
       
    34 import win32com
       
    35 win32com.__gen_path__ = genpydir
       
    36 win32com.__path__.insert(0, supportdir)
       
    37 # for older Pythons
       
    38 import copy_reg
       
    39