fix classpath for windows and CLASSPATH definition

This commit is contained in:
tshirtman 2013-01-03 13:12:40 +01:00
parent e10ed056bb
commit 7068b37d69
1 changed files with 3 additions and 3 deletions

View File

@ -20,19 +20,19 @@ def classpath():
import platform import platform
from glob import glob from glob import glob
from os import environ from os import environ
from os.path import realpath, dirname from os.path import realpath, dirname, join
if platform.system() == 'Windows': if platform.system() == 'Windows':
split_char = ';' split_char = ';'
else: else:
split_char = ':' split_char = ':'
paths = [realpath('.'), dirname(__file__) + '/src/org/', ] paths = [realpath('.'), join(dirname(__file__), 'src', 'org'), ]
if 'CLASSPATH' not in environ: if 'CLASSPATH' not in environ:
return split_char.join(paths) return split_char.join(paths)
cp = environ.get('CLASSPATH') cp = environ.get('CLASSPATH')
pre_paths = cp.split(split_char) pre_paths = paths + cp.split(split_char)
# deal with wildcards # deal with wildcards
for path in pre_paths: for path in pre_paths:
if not path.endswith('*'): if not path.endswith('*'):