[svn r38775] use relative paths, and compute them late

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-14 02:03:51 +01:00
parent f074f6137c
commit a90fb8112c
2 changed files with 8 additions and 8 deletions

View File

@ -19,8 +19,6 @@ nomagic = False
import py
Option = py.test.config.Option
here = py.magic.autopath().dirpath()
option = py.test.config.addoptions("execnet options",
Option('-S', '',
action="store", dest="sshtarget", default=None,
@ -28,13 +26,13 @@ option = py.test.config.addoptions("execnet options",
"user@codespeak.net")),
Option('', '--apigenpath',
action="store", dest="apigenpath",
default=here.join("../apigen").strpath,
default="../apigen",
type="string",
help="absolute path to where apigen docs are built"),
help="relative path to apigen doc output location (relative from py/)"),
Option('', '--docpath',
action='store', dest='docpath',
default=here.join('doc').strpath, type='string',
help='absolute path to where the docs are built'),
default="doc", type='string',
help="relative path to doc output location (relative from py/)"),
)
dist_rsync_roots = ['.']

View File

@ -4,6 +4,8 @@ from py.__.misc import rest
from py.__.apigen.linker import relpath
import os
pypkgdir = py.path.local(py.__file__).dirpath()
mypath = py.magic.autopath().dirpath()
Option = py.test.config.Option
@ -23,14 +25,14 @@ def get_apigenpath():
path = os.environ.get('APIGENPATH')
if path is None:
path = option.apigenpath
return py.path.local(path)
return pypkgdir.join(path, abs=True)
def get_docpath():
from py.__.conftest import option
path = os.environ.get('DOCPATH')
if path is None:
path = option.docpath
return py.path.local(path)
return pypkgdir.join(path, abs=True)
def get_apigen_relpath():
return relpath(get_apigenpath().strpath, get_docpath().strpath)