[3] | 1 | """ |
---|
| 2 | The sole purpose of this module is to alter the sys.path upon |
---|
| 3 | importing to add the current genetrack package's path first into |
---|
| 4 | the import path |
---|
| 5 | """ |
---|
| 6 | import sys, os |
---|
| 7 | |
---|
| 8 | def path_join(*args): |
---|
| 9 | return os.path.abspath(os.path.join(*args)) |
---|
| 10 | |
---|
| 11 | curr_dir = os.path.dirname( __file__ ) |
---|
| 12 | test_dir = path_join(curr_dir, '..') |
---|
| 13 | base_dir = path_join(curr_dir, '..', '..' ) |
---|
| 14 | lib_dir = path_join(base_dir, 'library') |
---|
| 15 | zip_dir = path_join(lib_dir, 'library.zip') |
---|
| 16 | |
---|
| 17 | for path in [ base_dir, lib_dir, zip_dir ]: |
---|
| 18 | if path not in sys.path: |
---|
| 19 | sys.path.insert(0, path ) |
---|
| 20 | |
---|
| 21 | # test that the modules in library.zip are accessible |
---|
| 22 | import twill, figleaf |
---|