Changeset a22d104 in sasmodels
- Timestamp:
- Mar 2, 2018 5:18:44 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2f733b1
- Parents:
- fc3ae1b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
r108e70e ra22d104 169 169 170 170 import sys 171 from os.path import abspath, dirname, join as joinpath, exists, getmtime 171 from os import environ 172 from os.path import abspath, dirname, join as joinpath, exists, getmtime, sep 172 173 import re 173 174 import string … … 897 898 load it from :mod:`sasmodels.models`. 898 899 """ 900 # TODO: Keep current scheme (.py looks in custom folders) 901 plugin_path = environ.get('PLUGIN_MODEL_DIR', None) 899 902 if model_name.endswith('.py'): 900 903 kernel_module = load_custom_kernel_module(model_name) 901 904 else: 902 from sasmodels import models 903 __import__('sasmodels.models.'+model_name) 904 kernel_module = getattr(models, model_name, None) 905 try: 906 from sasmodels import models 907 __import__('sasmodels.models.'+model_name) 908 kernel_module = getattr(models, model_name, None) 909 except Exception: 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) 905 914 return kernel_module 906 915
Note: See TracChangeset
for help on using the changeset viewer.