[py-svn] r37927 - in py/trunk/py/path: . svn

guido at codespeak.net guido at codespeak.net
Sun Feb 4 22:11:58 CET 2007


Author: guido
Date: Sun Feb  4 22:11:56 2007
New Revision: 37927

Modified:
   py/trunk/py/path/common.py
   py/trunk/py/path/svn/wccommand.py
Log:
Some docstrings.


Modified: py/trunk/py/path/common.py
==============================================================================
--- py/trunk/py/path/common.py	(original)
+++ py/trunk/py/path/common.py	Sun Feb  4 22:11:56 2007
@@ -93,6 +93,18 @@
     Checkers = Checkers
 
     def check(self, **kw):
+        """ check a path for existence, or query its properties
+
+            without arguments, this returns True if the path exists (on the
+            filesystem), False if not
+
+            with (keyword only) arguments, the object compares the value
+            of the argument with the value of a property with the same name
+            (if it has one, else it raises a TypeError)
+
+            when for example the keyword argument 'ext' is '.py', this will
+            return True if self.ext == '.py', False otherwise
+        """
         if kw:
             kw = kw.copy()
             if not checktype(self, kw):
@@ -177,6 +189,18 @@
         return repr(str(self))
 
     def visit(self, fil=None, rec=None, ignore=_dummyclass):
+        """ yields all paths below the current one
+
+            fil is a filter (glob pattern or callable), if not matching the
+            path will not be yielded, defaulting to None (everything is
+            returned)
+
+            rec is a filter (glob pattern or callable) that controls whether
+            a node is descended, defaulting to None
+
+            ignore is an Exception class that is ignoredwhen calling dirlist()
+            on any of the paths (by default, all exceptions are reported)
+        """
         if isinstance(fil, str):
             fil = fnmatch(fil)
         if rec: 

Modified: py/trunk/py/path/svn/wccommand.py
==============================================================================
--- py/trunk/py/path/svn/wccommand.py	(original)
+++ py/trunk/py/path/svn/wccommand.py	Sun Feb  4 22:11:56 2007
@@ -55,6 +55,7 @@
         return svncommon._escape_helper(cmd)
 
     def dump(self, obj):
+        """ pickle object into path location"""
         return self.localpath.dump(obj)
 
     def svnurl(self):
@@ -162,6 +163,10 @@
             error_enhance(sys.exc_info())
 
     def mkdir(self, *args):
+        """ create & return the directory joined with args. """
+        p = self.join(*args)
+        self._callex(os.mkdir, str(p))
+        return p
         if args:
             return self.join(*args).mkdir()
         else:
@@ -169,6 +174,7 @@
             return self
 
     def add(self):
+        """ add ourself to svn """
         self._svn('add')
 
     def remove(self, rec=1, force=1):


More information about the py-svn mailing list