Guarded inserts into sys.path.

This commit is contained in:
Jeremy Fincher 2003-08-30 19:20:08 +00:00
parent 7a51fccaf9
commit 442392b5ba
6 changed files with 25 additions and 10 deletions

View File

@ -2,8 +2,10 @@
import sys
sys.path.insert(0, 'src')
sys.path.insert(0, 'others')
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 *

View File

@ -29,7 +29,10 @@
# POSSIBILITY OF SUCH DAMAGE.
###
import sys
sys.path.insert(0, 'src')
if 'src' not in sys.path:
sys.path.insert(0, 'src')
from fix import *
from questions import *

View File

@ -2,7 +2,9 @@
import os
import sys
sys.path.insert(0, 'src')
if 'src' not in sys.path:
sys.path.insert(0, 'src')
from questions import *

View File

@ -40,7 +40,9 @@ import time
import optparse
started = time.time()
sys.path.insert(0, 'src')
if 'src' not in sys.path:
sys.path.insert(0, 'src')
import conf

View File

@ -30,14 +30,17 @@
###
import sys
sys.path.insert(0, 'src')
sys.path.insert(0, 'test')
sys.path.insert(0, 'plugins')
if 'src' not in sys.path:
sys.path.insert(0, 'src')
if 'test' not in sys.path:
sys.path.insert(0, 'test')
import conf
conf.dataDir = 'test-data'
if conf.pluginDir not in sys.path:
sys.path.insert(0, conf.pluginDir)
from fix import *
import gc

View File

@ -5,7 +5,10 @@ Converts from a "key => value\n" format to a cdb database.
"""
import sys
sys.path.insert(0, 'src')
if 'src' not in sys.path:
sys.path.insert(0, 'src')
import re
import cdb