Changeset a5da1f2 in sasmodels for sasmodels/__init__.py


Ignore:
Timestamp:
May 10, 2016 4:36:09 PM (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:
bd4ed1b
Parents:
848193e
Message:

fix path to models in frozen version of application

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/__init__.py

    rdc1e729 ra5da1f2  
    2424    """ 
    2525    from os.path import join as joinpath 
    26     from .generate import SIBLING_DIR, DATA_PATH 
     26    import glob 
     27 
     28    from .generate import EXTERNAL_DIR, DATA_PATH 
     29 
    2730    data_files = {} 
    2831    def add_patterns(path, patterns): 
    29         data_files[joinpath(SIBLING_DIR, *path)] \ 
     32        data_files[joinpath(EXTERNAL_DIR, *path)] \ 
    3033            = [joinpath(DATA_PATH, *(path+[p])) for p in patterns] 
    3134    add_patterns([], ['*.c', '*.cl', 'convert.json']) 
     
    3437 
    3538    # Fish out full paths for all files. 
    36     import glob 
    3739    return_list=[] 
    38     for key, values in data_files.iteritems(): 
     40    for path, patterns in data_files.items(): 
    3941        files_data=[] 
    40         for value in values: 
    41             files_data += [file for file in glob.glob(value)] 
    42         return_list.append([key, files_data]) 
     42        for pattern in patterns: 
     43            files_data.extend(glob.glob(pattern)) 
     44        return_list.append([path, files_data]) 
    4345    return return_list 
    4446 
Note: See TracChangeset for help on using the changeset viewer.