Changes in src/sas/_config.py [93b34cc:b963b20] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/_config.py
r93b34cc rb963b20 86 86 def setup_custom_config(app_dir, user_dir): 87 87 path = make_custom_config_path(user_dir) 88 #logger.info("custom config path %s", path)89 88 if not os.path.isfile(path): 90 89 try: … … 95 94 logger.error("Could not copy default custom config.") 96 95 97 custom_config = load_custom_config(path)98 99 96 #Adding SAS_OPENCL if it doesn't exist in the config file 100 97 # - to support backcompability 101 if not hasattr(custom_config, "SAS_OPENCL"): 102 custom_config.SAS_OPENCL = None 98 if not "SAS_OPENCL" in open(path).read(): 103 99 try: 104 open( path, "a+").write("SAS_OPENCL = \"None\"\n")100 open(config_file, "a+").write("SAS_OPENCL = \"None\"\n") 105 101 except Exception: 106 102 logger.error("Could not update custom config with SAS_OPENCL.") 107 103 104 custom_config = load_custom_config(path) 108 105 return custom_config 106 109 107 110 108 def load_custom_config(path):
Note: See TracChangeset
for help on using the changeset viewer.