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

View File

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