Changeset 457

Show
Ignore:
Timestamp:
Mon May 5 12:31:50 2008
Author:
naufraghi
Message:

Merged revisions 394-400 via svnmerge from
https://svn.pyinstaller.python-hosting.com/trunk[[BR]]
........

r394 | naufraghi | 2007-12-21 19:44:22 +0100 (Fri, 21 Dec 2007) | 1 line

Reformat imports
........
r395 | naufraghi | 2007-12-21 19:50:23 +0100 (Fri, 21 Dec 2007) | 1 line

Fix quoting
........
r396 | naufraghi | 2007-12-21 19:52:54 +0100 (Fri, 21 Dec 2007) | 1 line

Support path in _xmlplus
........
r397 | naufraghi | 2007-12-21 19:56:21 +0100 (Fri, 21 Dec 2007) | 1 line

Avoid importing os, it causes problems in python 2.5
........
r398 | naufraghi | 2007-12-21 19:58:56 +0100 (Fri, 21 Dec 2007) | 1 line

Add support for path modified by a module (like _xmlplus)
........
r399 | naufraghi | 2007-12-21 20:18:57 +0100 (Fri, 21 Dec 2007) | 1 line

Add recent python compatibility
........
r400 | naufraghi | 2007-12-21 20:20:49 +0100 (Fri, 21 Dec 2007) | 1 line

Rework path handling + add test selector
........

Files:

Legend:

Unmodified
Added
Removed
Modified
  • branches/crypt/buildtests/test5.py

    r43 r457  
    16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA  
    17 17 print "test5 - W ignore"  
    18   import regex  
      18 try:  
      19     import regex  
      20 except ImportError:  
      21     import re  
    19 22 print "test5 - done"  
  • branches/crypt/buildtests/runtests.py

    r101 r457  
    28 28 except NameError:  
    29 29     here=os.path.dirname(sys.argv[0])  
      30 os.chdir(here)  
    30 31 PYTHON = sys.executable  
    31 32 if sys.platform[:3] == 'win':  
     
    34 35  
    35 36 def clean():  
    36       distdirs = glob.glob(os.path.join(here, 'disttest*'))  
      37     distdirs = glob.glob('disttest*')  
    36 37     for dir in distdirs:  
    37 38         try:  
     
    40 41         except OSError, e:  
    41 42             print e  
    42       builddirs = glob.glob(os.path.join(here, 'buildtest*'))  
      43     builddirs = glob.glob('buildtest*')  
    42 43     for dir in builddirs:  
    43 44         try:  
     
    46 47         except OSError, e:  
    47 48             print e  
    48       wfiles = glob.glob(os.path.join(here, 'warn*.txt'))  
      49     wfiles = glob.glob('warn*.txt')  
    48 49     for file in wfiles:  
    49 50         try:  
     
    53 54             print e  
    54 55  
    55   def runtests():  
    56       global here  
    57       sources = glob.glob(os.path.join(here, 'test*[0-9].py'))  
      56 def runtests(sources=None):  
      57     info = "Executing PyInstaller tests in: %s" % os.getcwd()  
      58     print "*"*len(info)  
      59     print info  
      60     print "*"*len(info)  
      61     alltests = glob.glob('test*[0-9].py')  
      62     if not sources:  
      63         tests = alltests  
      64     else:  
      65         tests = []  
      66         for part in sources:  
      67             tests += [t for t in alltests if part in t and t not in tests]  
      68     tests.sort(key=lambda x: (len(x), x)) # test1 < test10  
    58 69     path = os.environ["PATH"]  
    59       for src in sources:  
      70     for src in tests:  
    59 70         print  
    60           print "################## EXECUTING TEST %s ################################" % src  
      71         print "################## BUILDING TEST %s #################################" % src  
    60 71         print  
    61 72         test = os.path.splitext(os.path.basename(src))[0]  
     
    65 76         # Run the test in a clean environment to make sure they're really self-contained  
    66 77         del os.environ["PATH"]  
    67           os.system('dist%s%s%s' % (test, os.sep, test))  
      78         print  
      79         print "################## EXECUTING TEST %s ################################" % src  
      80         print  
      81         res = os.system('dist%s%s%s.exe' % (test, os.sep, test))  
    68 82         os.environ["PATH"] = path  
    69           print "################## FINISHING TEST %s  ################################" % src  
      83         assert res == 0, "%s Test error!" % src  
      84         print "################## FINISHING TEST %s ################################" % src  
    70 85  
    71 86 if __name__ == '__main__':  
     
    76 91         clean()  
    77 92     if '--run' in sys.argv:  
    78           runtests()  
    79       raw_input("Press any key to exit")  
      93         runtests(sys.argv[2:])  
  • branches/crypt/hooks/hook-xml.py

    r455 r457  
    30 30         cmd = '"echo on && "%s" -c "import xml;print xml.__file__" > "%s""' % (exe, fnm)  
    31 31     else:  
    32           cmd = '""%s" -c "import xml;print xml.__file__" > "%s""' % (exe, fnm)  
      32         cmd = '"%s" -c "import xml;print xml.__file__" > "%s"' % (exe, fnm)  
    32 32     os.system(cmd)  
    33 33  
     
    39 39             txt = txt + 'c'  
    40 40         co = marshal.loads(open(txt, 'rb').read()[8:])  
      41         old_pth = mod.__path__[:]  
    41 42         mod.__init__('xml', txt, co)  
      43         mod.__path__.extend(old_pth)  
    42 44     return mod  
  • branches/crypt/Build.py

    r456 r457  
    17 17 # along with this program; if not, write to the Free Software  
    18 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA  
    19   import sys, os, shutil, mf, archive, iu, carchive, pprint, time, py_compile, bindepend, tempfile, md5  
      19 import sys  
      20 import os  
      21 import shutil  
      22 import pprint  
      23 import time  
      24 import py_compile  
      25 import tempfile  
      26 import md5  
      27  
      28 import mf  
      29 import archive  
      30 import iu  
      31 import carchive  
      32 import bindepend  
    20 33  
    21 34 STRINGTYPE = type('')  
  • branches/crypt/mf.py

    r455 r457  
    526 526         pth = os.path.dirname(pth)  
    527 527         self.__path__ = [ pth ]  
    528           self.subimporter = PathImportDirector(self.__path__)  
      528         self._update_director(force=True)  
      529     def _update_director(self, force=False):  
      530         if force or self.subimporter.path != self.__path__:  
      531             self.subimporter = PathImportDirector(self.__path__)  
    529 532     def doimport(self, nm):  
      533         self._update_director()  
    530 534         mod = self.subimporter.getmod(nm)  
    531 535         if mod:  
  • branches/crypt/support/rthooks/opengl.py

    r219 r457  
    34 34  
    35 35 def myopen(fn, *args):  
    36       import os  
    37       lastdir = os.path.basename(os.path.dirname(fn))  
    38       if os.path.basename(fn) == "version" and os.path.splitext(lastdir)[1] == ".pyz":  
    39           import cStringIO  
      36     if fn.endswith("version") and ".pyz" in fn:  
    40 37         # Restore original open, since we're almost done  
    41 38         __builtins__.__dict__["open"] = __realopen__  
     
    43 40         # used by the library, but it needs to be made of four numbers  
    44 41         # separated by dots.  
      42         import cStringIO  
    45 43         return cStringIO.StringIO("0.0.0.0")  
    46 44     return __realopen__(fn, *args)