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

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jan 9 15:56:26 CET 2007


Author: cfbolz
Date: Tue Jan  9 15:56:24 2007
New Revision: 36359

Modified:
   py/dist/py/path/common.py
   py/dist/py/path/local/local.py
   py/dist/py/path/svn/urlcommand.py
Log:
add some doc strings to paths


Modified: py/dist/py/path/common.py
==============================================================================
--- py/dist/py/path/common.py	(original)
+++ py/dist/py/path/common.py	Tue Jan  9 15:56:24 2007
@@ -316,6 +316,8 @@
             f.close()
 
     def readlines(self, cr=1):
+        """ read and return a list of lines from the path. if cr is False, the
+newline will be removed from the end of each line. """
         if not cr:
             content = self.read('rU')
             return content.split('\n')
@@ -336,6 +338,7 @@
             f.close()
 
     def move(self, target):
+        """ move this path to target. """
         if target.relto(self):
             raise py.error.EINVAL(target, "cannot move path into a subdirectory of itself")
         try:

Modified: py/dist/py/path/local/local.py
==============================================================================
--- py/dist/py/path/local/local.py	(original)
+++ py/dist/py/path/local/local.py	Tue Jan  9 15:56:24 2007
@@ -246,6 +246,7 @@
                     newx.ensure(dir=1)
 
     def rename(self, target):
+        """ rename this path to target. """
         return self._callex(os.rename, str(self), str(target))
 
     def dump(self, obj, bin=1):

Modified: py/dist/py/path/svn/urlcommand.py
==============================================================================
--- py/dist/py/path/svn/urlcommand.py	(original)
+++ py/dist/py/path/svn/urlcommand.py	Tue Jan  9 15:56:24 2007
@@ -83,7 +83,7 @@
                             'svn cat -r %s "%s"' % (self.rev, self._escape(self.strpath)))
 
     def dirpath(self, *args, **kwargs):
-        """ return the directory Path of the current Path joined
+        """ return the directory path of the current path joined
             with any given path arguments.
         """
         l = self.strpath.split(self.sep) 
@@ -96,6 +96,8 @@
 
     # modifying methods (cache must be invalidated)
     def mkdir(self, *args, **kwargs):
+        """ create & return the directory joined with args. You can provide
+a checkin message by giving a keyword argument 'msg'"""
         commit_msg=kwargs.get('msg', "mkdir by py lib invocation")
         createpath = self.join(*args)
         createpath._svnwrite('mkdir', '-m', commit_msg)
@@ -103,6 +105,7 @@
         return createpath
 
     def copy(self, target, msg='copied by py lib invocation'):
+        """ copy path to target with checkin msg msg."""
         if getattr(target, 'rev', None) is not None:
             raise py.error.EINVAL(target, "revisions are immutable")
         process.cmdexec('svn copy -m "%s" "%s" "%s"' %(msg, 
@@ -110,6 +113,7 @@
         self._lsnorevcache.delentry(target.dirpath().strpath)
 
     def rename(self, target, msg="renamed by py lib invocation"):
+        """ rename this path to target with checkin message msg. """
         if getattr(self, 'rev', None) is not None:
             raise py.error.EINVAL(self, "revisions are immutable")
         py.process.cmdexec('svn move -m "%s" --force "%s" "%s"' %(
@@ -118,6 +122,8 @@
         self._lsnorevcache.delentry(self.strpath)
 
     def remove(self, rec=1, msg='removed by py lib invocation'):
+        """ remove a file or directory (or a directory tree if rec=1) with
+checkin message msg."""
         if self.rev is not None:
             raise py.error.EINVAL(self, "revisions are immutable")
         process.cmdexec('svn rm -m "%s" "%s"' %(msg, self._escape(self)))



More information about the pytest-commit mailing list