diff --git a/plugins/baseplugin.py b/plugins/baseplugin.py index 583e85814..1218f2d45 100644 --- a/plugins/baseplugin.py +++ b/plugins/baseplugin.py @@ -1,12 +1,5 @@ #!/usr/bin/env python -import sys - -if 'sys' not in sys.path: - sys.path.insert(0, 'src') -if 'others' not in sys.path: - sys.path.insert(0, 'others') - from fix import * import os diff --git a/src/conf.py b/src/conf.py index 228623c5d..2b55fae18 100644 --- a/src/conf.py +++ b/src/conf.py @@ -31,6 +31,8 @@ from fix import * +import sys + import sets import os.path @@ -46,7 +48,8 @@ import os.path logDir = 'logs' confDir = 'conf' dataDir = 'data' -pluginDirs = ['src', 'plugins'] +installDir = os.path.dirname(os.path.dirname(sys.modules[__name__].__file__)) +pluginDirs = [os.path.join(installDir, s) for s in ('src', 'plugins')] ### # Files. diff --git a/src/fix.py b/src/fix.py index 52e4f581d..989d3c470 100644 --- a/src/fix.py +++ b/src/fix.py @@ -35,11 +35,6 @@ Fixes stuff that Python should have but doesn't. """ -import sys - -if 'others' not in sys.path: - sys.path.insert(0, 'others') - import string string.ascii = string.maketrans('', '') diff --git a/test/test.py b/test/test.py index 5f1b9cd67..60645604a 100755 --- a/test/test.py +++ b/test/test.py @@ -29,11 +29,7 @@ # POSSIBILITY OF SUCH DAMAGE. ### -import sys -if 'src' not in sys.path: - sys.path.insert(0, 'src') -if 'test' not in sys.path: - sys.path.insert(0, 'test') +import supybot import conf conf.dataDir = 'test-data' @@ -45,6 +41,7 @@ from fix import * import gc import re +import sys import imp import glob import time