Changeset 92583049 in sasview


Ignore:
Timestamp:
Jan 6, 2017 8:20:35 AM (8 years ago)
Author:
wojciech
Children:
f370ea07
Parents:
e2c0939
Message:

Adding back-compatibility support if SAS_OPENCL is not set in config_file

Location:
src/sas/sasgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/customdir.py

    r212bfc2 r92583049  
    3434        if not os.path.isfile(config_file): 
    3535            shutil.copyfile(os.path.join(path, "custom_config.py"), config_file) 
     36 
     37        #Adding SAS_OPENCL if it doesn't exist in the config file 
     38        # - to support backcompability 
     39        if not "SAS_OPENCL" in open(config_file).read(): 
     40            open(config_file,"a+").write("SAS_OPENCL = \"None\"\n") 
    3641    except: 
    3742        # Check for data path next to exe/zip file. 
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    re2c0939 r92583049  
    7979        #Check if SAS_OPENCL is already set as enviromental variable 
    8080        self.sas_opencl = os.environ.get("SAS_OPENCL","") 
    81          
     81 
    8282        for clopt in clinfo: 
    8383            button = wx.CheckBox(self.panel1, -1, label=clopt[1], name=clopt[1]) 
     
    106106        accept_btn = wx.Button(self, wx.ID_OK) 
    107107        accept_btn.SetToolTipString("Accept new OpenCL settings. This will" 
    108                                     " overwrite SAS_OPENCL variable if set") 
     108                                    " override SAS_OPENCL variable if set") 
    109109 
    110110        help_id = wx.NewId() 
Note: See TracChangeset for help on using the changeset viewer.