[py-svn] r37776 - py/trunk/py/doc

guido at codespeak.net guido at codespeak.net
Fri Feb 2 00:12:53 CET 2007


Author: guido
Date: Fri Feb  2 00:12:49 2007
New Revision: 37776

Modified:
   py/trunk/py/doc/conftest.py
   py/trunk/py/doc/misc.txt
   py/trunk/py/doc/path.txt
Log:
Fixed some problems with the relative link checker (was using the wrong base
path for checks), fixed links in the documents.


Modified: py/trunk/py/doc/conftest.py
==============================================================================
--- py/trunk/py/doc/conftest.py	(original)
+++ py/trunk/py/doc/conftest.py	Fri Feb  2 00:12:49 2007
@@ -14,25 +14,27 @@
         )
 ) 
 
-_initialized = False
-def checkdocutils(path): 
-    global _initialized
+def checkdocutils():
     try:
         import docutils
     except ImportError:
         py.test.skip("docutils not importable")
-    if not _initialized:
-        from py.__.rest import directive
-        directive.register_linkrole('api', get_resolve_linkrole(path))
-        directive.register_linkrole('source', get_resolve_linkrole(path))
-        _initialized = True
+
+def initrestdirectives(path):
+    from py.__.rest import directive
+    dirpath = path.dirpath()
+    # XXX note that this gets called for every test, because the path is
+    # different every test...
+    directive.register_linkrole('api', get_resolve_linkrole(dirpath))
+    directive.register_linkrole('source', get_resolve_linkrole(dirpath))
 
 def restcheck(path):
     localpath = path
     if hasattr(path, 'localpath'):
         localpath = path.localpath
     _checkskip(localpath)
-    checkdocutils(localpath) 
+    checkdocutils() 
+    initrestdirectives(localpath)
     import docutils.utils
 
     try: 
@@ -262,6 +264,7 @@
             if not py.path.local(checkpath).join(ret[1]).check():
                 raise AssertionError(
                     '%s linkrole: %s points to non-existant path %s' % (
-                     name, ret[0], ret[1]))
+                     name, ret[0], py.path.local(checkpath).join(ret[1])))
         return ret
     return resolve_linkrole
+

Modified: py/trunk/py/doc/misc.txt
==============================================================================
--- py/trunk/py/doc/misc.txt	(original)
+++ py/trunk/py/doc/misc.txt	Fri Feb  2 00:12:49 2007
@@ -93,7 +93,8 @@
 Currently, the py lib offers two ways to interact with
 system executables. :api:`py.process.cmdexec()` invokes
 the shell in order to execute a string.  The other
-one, :api:`py.path.local.sysexec()` lets you directly execute a binary. 
+one, :api:`py.path.local`'s 'sysexec()' method lets you 
+directly execute a binary. 
 
 Both approaches will raise an exception in case of a return-
 code other than 0 and otherwise return the stdout-output 
@@ -217,3 +218,4 @@
    module)
 
 :api:`py.builtin.BaseException` is just ``Exception`` before Python 2.5.
+

Modified: py/trunk/py/doc/path.txt
==============================================================================
--- py/trunk/py/doc/path.txt	(original)
+++ py/trunk/py/doc/path.txt	Fri Feb  2 00:12:49 2007
@@ -209,10 +209,10 @@
 of platform-dependencies as much as possible). 
 
 There is some experimental small approach 
-(:source:`py/path/gateway`) aiming at having
+(:source:`py/path/gateway/`) aiming at having
 a convenient Remote Path implementation
 and some considerations about future 
-works in the according :source:`py/path/gateway/todo.txt`
+works in the according :source:`py/path/gateway/TODO.txt`
 
 There are various hacks out there to have
 Memory-Filesystems and even path objects


More information about the py-svn mailing list