[py-svn] r33065 - py/dist/py/path/local

fijal at codespeak.net fijal at codespeak.net
Mon Oct 9 17:03:36 CEST 2006


Author: fijal
Date: Mon Oct  9 17:03:35 2006
New Revision: 33065

Modified:
   py/dist/py/path/local/local.py
Log:
Added -<username> linking (stolen from pypy)


Modified: py/dist/py/path/local/local.py
==============================================================================
--- py/dist/py/path/local/local.py	(original)
+++ py/dist/py/path/local/local.py	Mon Oct  9 17:03:35 2006
@@ -618,6 +618,27 @@
                         path.remove(rec=1)
                     except py.error.Error:
                         pass
+        
+        # make link...
+        try:
+            username = os.environ['USER']           #linux, et al
+        except:
+            try:
+                username = os.environ['USERNAME']   #windows
+            except:
+                username = 'current'
+
+        src  = str(udir)
+        dest = src[:src.rfind('-')] + '-' + username
+        try:
+            os.unlink(dest)
+        except:
+            pass
+        try:
+            os.symlink(src, dest)
+        except:
+            pass
+
         return udir
     make_numbered_dir = classmethod(make_numbered_dir)
 


More information about the py-svn mailing list