[svn r37776] Fixed some problems with the relative link checker (was using the wrong base
path for checks), fixed links in the documents. --HG-- branch : trunk
This commit is contained in:
parent
80a0045805
commit
23aeccc8c8
|
@ -14,25 +14,27 @@ option = py.test.config.addoptions("documentation check options",
|
|||
)
|
||||
)
|
||||
|
||||
_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 @@ def get_resolve_linkrole(checkpath=None):
|
|||
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
|
||||
|
||||
|
|
|
@ -93,7 +93,8 @@ sources:
|
|||
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 @@ are pure-Python reimplementations. These currently are:
|
|||
module)
|
||||
|
||||
:api:`py.builtin.BaseException` is just ``Exception`` before Python 2.5.
|
||||
|
||||
|
|
|
@ -209,10 +209,10 @@ to provide this choice (and getting rid
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue