Changes in / [a0243f7:bf94e6e] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
rf9c8474 r6cbdcd4 169 169 170 170 import sys 171 from os import environ 172 from os.path import abspath, dirname, join as joinpath, exists, getmtime, sep 171 from os.path import abspath, dirname, join as joinpath, exists, getmtime 173 172 import re 174 173 import string … … 901 900 kernel_module = load_custom_kernel_module(model_name) 902 901 else: 903 try: 904 from sasmodels import models 905 __import__('sasmodels.models.'+model_name) 906 kernel_module = getattr(models, model_name, None) 907 except ImportError: 908 # If the model isn't a built in model, try the plugin directory 909 plugin_path = environ.get('SAS_MODELPATH', None) 910 if plugin_path is not None: 911 file_name = model_name.split(sep)[-1] 912 model_name = plugin_path + sep + file_name + ".py" 913 kernel_module = load_custom_kernel_module(model_name) 914 else: 915 raise 902 from sasmodels import models 903 __import__('sasmodels.models.'+model_name) 904 kernel_module = getattr(models, model_name, None) 916 905 return kernel_module 917 906
Note: See TracChangeset
for help on using the changeset viewer.