Changeset 2a0c7a6 in sasmodels


Ignore:
Timestamp:
Sep 12, 2016 1:18:36 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
4cc161e
Parents:
424fe00
Message:

allow ~ expansion in model names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/custom/__init__.py

    r40a87fa r2a0c7a6  
    1717    def load_module_from_path(fullname, path): 
    1818        """load module from *path* as *fullname*""" 
    19         spec = spec_from_file_location(fullname, path) 
     19        spec = spec_from_file_location(fullname, os.path.expanduser(path)) 
    2020        module = module_from_spec(spec) 
    2121        spec.loader.exec_module(module) 
     
    2626    def load_module_from_path(fullname, path): 
    2727        """load module from *path* as *fullname*""" 
    28         module = imp.load_source(fullname, path) 
     28        module = imp.load_source(fullname, os.path.expanduser(path)) 
    2929        #os.unlink(path+"c")  # remove the automatic pyc file 
    3030        return module 
     
    3535    name = basename(splitext(path)[0]) 
    3636    # Placing the model in the 'sasmodels.custom' name space. 
    37     kernel_module = load_module_from_path('sasmodels.custom.'+name, path) 
     37    kernel_module = load_module_from_path('sasmodels.custom.'+name, 
     38                                          os.path.expanduser(path)) 
    3839    return kernel_module 
Note: See TracChangeset for help on using the changeset viewer.