[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():
|
||||||
def checkdocutils(path):
|
|
||||||
global _initialized
|
|
||||||
try:
|
try:
|
||||||
import docutils
|
import docutils
|
||||||
except ImportError:
|
except ImportError:
|
||||||
py.test.skip("docutils not importable")
|
py.test.skip("docutils not importable")
|
||||||
if not _initialized:
|
|
||||||
from py.__.rest import directive
|
def initrestdirectives(path):
|
||||||
directive.register_linkrole('api', get_resolve_linkrole(path))
|
from py.__.rest import directive
|
||||||
directive.register_linkrole('source', get_resolve_linkrole(path))
|
dirpath = path.dirpath()
|
||||||
_initialized = True
|
# 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):
|
def restcheck(path):
|
||||||
localpath = path
|
localpath = path
|
||||||
if hasattr(path, 'localpath'):
|
if hasattr(path, 'localpath'):
|
||||||
localpath = path.localpath
|
localpath = path.localpath
|
||||||
_checkskip(localpath)
|
_checkskip(localpath)
|
||||||
checkdocutils(localpath)
|
checkdocutils()
|
||||||
|
initrestdirectives(localpath)
|
||||||
import docutils.utils
|
import docutils.utils
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -262,6 +264,7 @@ def get_resolve_linkrole(checkpath=None):
|
||||||
if not py.path.local(checkpath).join(ret[1]).check():
|
if not py.path.local(checkpath).join(ret[1]).check():
|
||||||
raise AssertionError(
|
raise AssertionError(
|
||||||
'%s linkrole: %s points to non-existant path %s' % (
|
'%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 ret
|
||||||
return resolve_linkrole
|
return resolve_linkrole
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,8 @@ sources:
|
||||||
Currently, the py lib offers two ways to interact with
|
Currently, the py lib offers two ways to interact with
|
||||||
system executables. :api:`py.process.cmdexec()` invokes
|
system executables. :api:`py.process.cmdexec()` invokes
|
||||||
the shell in order to execute a string. The other
|
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-
|
Both approaches will raise an exception in case of a return-
|
||||||
code other than 0 and otherwise return the stdout-output
|
code other than 0 and otherwise return the stdout-output
|
||||||
|
@ -217,3 +218,4 @@ are pure-Python reimplementations. These currently are:
|
||||||
module)
|
module)
|
||||||
|
|
||||||
:api:`py.builtin.BaseException` is just ``Exception`` before Python 2.5.
|
: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).
|
of platform-dependencies as much as possible).
|
||||||
|
|
||||||
There is some experimental small approach
|
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
|
a convenient Remote Path implementation
|
||||||
and some considerations about future
|
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
|
There are various hacks out there to have
|
||||||
Memory-Filesystems and even path objects
|
Memory-Filesystems and even path objects
|
||||||
|
|
Loading…
Reference in New Issue