[py-svn] r7229 - in py/dist/py/path: . local svn

hpk at codespeak.net hpk at codespeak.net
Sun Nov 14 14:31:20 CET 2004


Author: hpk
Date: Sun Nov 14 14:31:19 2004
New Revision: 7229

Modified:
   py/dist/py/path/common.py
   py/dist/py/path/local/local.py
   py/dist/py/path/svn/svncommon.py
Log:
moved the dirpath() implementation to the FSPathPase 
because it is rather generic. 



Modified: py/dist/py/path/common.py
==============================================================================
--- py/dist/py/path/common.py	(original)
+++ py/dist/py/path/common.py	Sun Nov 14 14:31:19 2004
@@ -235,6 +235,12 @@
     def __div__(self, other):
         return self.join(str(other))
 
+    def dirpath(self, *args):
+        """ return the directory Path of the current Path joined
+            with any given path arguments. 
+        """
+        return self.new(basename='').join(*args) 
+
     def ext(self):
         return self.get('ext')
     ext = property(ext, None, None, 'extension part of path') 

Modified: py/dist/py/path/local/local.py
==============================================================================
--- py/dist/py/path/local/local.py	(original)
+++ py/dist/py/path/local/local.py	Sun Nov 14 14:31:19 2004
@@ -171,13 +171,6 @@
     def __eq__(self, other):
         return str(self) == str(other)
 
-    def dirpath(self, *args):
-        x = self.new(basename='')
-        if args:
-            return x.join(*args)
-        else:
-            return x 
-
     def open(self, mode='r'):
         """ return an opened file with the given mode. """
         return callex(open, self.strpath, mode) 

Modified: py/dist/py/path/svn/svncommon.py
==============================================================================
--- py/dist/py/path/svn/svncommon.py	(original)
+++ py/dist/py/path/svn/svncommon.py	Sun Nov 14 14:31:19 2004
@@ -115,10 +115,6 @@
         newpath = self.__class__(self.sep.join(parts), self.rev)
         return newpath
 
-    def dirpath(self, *args):
-        """ return the directory Path of the current Path. """
-        return self.new(basename='').join(*args)
-
     def propget(self, name):
         """ return the content of the given property. """
         value = self._propget(name)



More information about the pytest-commit mailing list