[pypy-svn] rev 2245 - pypy/trunk/src/pypy/translator

hpk at codespeak.net hpk at codespeak.net
Sat Nov 22 15:39:21 CET 2003


Author: hpk
Date: Sat Nov 22 15:39:20 2003
New Revision: 2245

Removed:
   pypy/trunk/src/pypy/translator/autopath.py
Modified:
   pypy/trunk/src/pypy/translator/gencl.py
   pypy/trunk/src/pypy/translator/transform.py
   pypy/trunk/src/pypy/translator/translator.py
Log:
removed autopath.py and references because there are no real direct
script executions here.



Deleted: /pypy/trunk/src/pypy/translator/autopath.py
==============================================================================
--- /pypy/trunk/src/pypy/translator/autopath.py	Sat Nov 22 15:39:20 2003
+++ (empty file)
@@ -1,78 +0,0 @@
-"""
-self cloning, automatic path configuration 
-
-copy this into any subdirectory of pypy from which scripts need 
-to be run, typically all of the test subdirs. 
-The idea is that any such script simply issues
-
-    import autopath
-
-and this will make sure that the parent directory containing "pypy"
-is in sys.path. 
-
-If you modify the master "autopath.py" version (in pypy/tool/autopath.py) 
-you can directly run it which will copy itself on all autopath.py files
-it finds under the pypy root directory. 
-
-This module always provides these attributes:
-
-    pypydir    pypy root directory path 
-    this_dir   directory where this autopath.py resides 
-
-"""
-
-
-def __dirinfo(part):
-    """ return (partdir, this_dir) and insert parent of partdir
-    into sys.path. If the parent directories dont have the part
-    an EnvironmentError is raised."""
-
-    import sys, os 
-    try:
-        head = this_dir = os.path.abspath(os.path.dirname(__file__))
-    except NameError:
-        head = this_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
-
-    while head:
-        partdir = head
-        head, tail = os.path.split(head)
-        if tail == part:
-            sys.path = [p for p in sys.path if not p.startswith(head)]
-            if head not in sys.path:
-                sys.path.insert(0, head)
-            return partdir, this_dir
-        
-    raise EnvironmentError, "'%s' missing in '%r'" % (pathpart,this_path)
-
-def __clone():
-    """ clone master version of autopath.py into all subdirs """
-    from os.path import join, walk
-    if not this_dir.endswith(join('pypy','tool')):
-        raise EnvironmentError("can only clone master version "
-                               "'%s'" % join(pypydir, 'tool',_myname))
-
-
-    def sync_walker(arg, dirname, fnames):
-        if _myname in fnames:
-            fn = join(dirname, _myname)
-            f = open(fn, 'rwb+')
-            try:
-                if f.read() == arg:
-                    print "checkok", fn
-                else:
-                    print "syncing", fn
-                    f = open(fn, 'w')
-                    f.write(arg)
-            finally:
-                f.close()
-    s = open(join(pypydir, 'tool', _myname), 'rb').read()
-    walk(pypydir, sync_walker, s)
-
-_myname = 'autopath.py'
-
-# set guaranteed attributes
-
-pypydir, this_dir = __dirinfo('pypy')
-
-if __name__ == '__main__':
-    __clone()

Modified: pypy/trunk/src/pypy/translator/gencl.py
==============================================================================
--- pypy/trunk/src/pypy/translator/gencl.py	(original)
+++ pypy/trunk/src/pypy/translator/gencl.py	Sat Nov 22 15:39:20 2003
@@ -1,4 +1,3 @@
-import autopath
 from pypy.objspace.flow.model import *
 from pypy.objspace.flow.objspace import implicitexc
 from pypy.translator.annrpython import RPythonAnnotator

Modified: pypy/trunk/src/pypy/translator/transform.py
==============================================================================
--- pypy/trunk/src/pypy/translator/transform.py	(original)
+++ pypy/trunk/src/pypy/translator/transform.py	Sat Nov 22 15:39:20 2003
@@ -4,7 +4,6 @@
 transformation may introduce new space operation.
 """
 
-import autopath
 import types
 from pypy.objspace.flow.model import SpaceOperation
 from pypy.translator.annotation import XCell, XConstant

Modified: pypy/trunk/src/pypy/translator/translator.py
==============================================================================
--- pypy/trunk/src/pypy/translator/translator.py	(original)
+++ pypy/trunk/src/pypy/translator/translator.py	Sat Nov 22 15:39:20 2003
@@ -28,8 +28,7 @@
 Try dir(test) for list of current snippets.
 """
 
-
-import autopath
+import test.autopath
 
 from pypy.objspace.flow.model import *
 from pypy.translator.annotation import *


More information about the Pypy-commit mailing list