Changeset 2f733b1 in sasmodels
- Timestamp:
- Mar 6, 2018 9:56:22 AM (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:
- f9c8474
- Parents:
- a22d104
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
ra22d104 r2f733b1 898 898 load it from :mod:`sasmodels.models`. 899 899 """ 900 # TODO: Keep current scheme (.py looks in custom folders)901 plugin_path = environ.get('PLUGIN_MODEL_DIR', None)902 900 if model_name.endswith('.py'): 903 901 kernel_module = load_custom_kernel_module(model_name) … … 907 905 __import__('sasmodels.models.'+model_name) 908 906 kernel_module = getattr(models, model_name, None) 909 except Exception: 907 except ImportError: 908 # If the model isn't a built in model, try the plugin directory 909 plugin_path = environ.get('PLUGIN_MODEL_DIR', None) 910 910 if plugin_path is not None: 911 911 file_name = model_name.split(sep)[-1] 912 912 model_name = plugin_path + sep + file_name + ".py" 913 kernel_module = load_custom_kernel_module(model_name) 913 kernel_module = load_custom_kernel_module(model_name) 914 else: 915 raise 914 916 return kernel_module 915 917
Note: See TracChangeset
for help on using the changeset viewer.