Changes in src/sas/_config.py [b963b20:93b34cc] in sasview


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/_config.py

    rb963b20 r93b34cc  
    8686def setup_custom_config(app_dir, user_dir): 
    8787    path = make_custom_config_path(user_dir) 
     88    #logger.info("custom config path %s", path) 
    8889    if not os.path.isfile(path): 
    8990        try: 
     
    9495            logger.error("Could not copy default custom config.") 
    9596 
     97    custom_config = load_custom_config(path) 
     98 
    9699    #Adding SAS_OPENCL if it doesn't exist in the config file 
    97100    # - to support backcompability 
    98     if not "SAS_OPENCL" in open(path).read(): 
     101    if not hasattr(custom_config, "SAS_OPENCL"): 
     102        custom_config.SAS_OPENCL = None 
    99103        try: 
    100             open(config_file, "a+").write("SAS_OPENCL = \"None\"\n") 
     104            open(path, "a+").write("SAS_OPENCL = \"None\"\n") 
    101105        except Exception: 
    102106            logger.error("Could not update custom config with SAS_OPENCL.") 
    103107 
    104     custom_config = load_custom_config(path) 
    105108    return custom_config 
    106  
    107109 
    108110def load_custom_config(path): 
Note: See TracChangeset for help on using the changeset viewer.