Changeset 6c6aa83 in sasview


Ignore:
Timestamp:
Jan 2, 2017 3:09:21 AM (7 years ago)
Author:
wojciech
Children:
b39debba
Parents:
62243ae
Message:

Writting to settings file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    r62243ae r6c6aa83  
    2525 
    2626    def __init__(self, *args, **kwds): 
    27  
    28         # from sas.sasgui.guiframe.customdir import SetupCustom 
    29         # from sas.sasgui.guiframe.gui_manager import get_app_dir, _find_local_config 
    30         # 
    31         # PATH_APP = get_app_dir() 
    32         # c_conf_dir = SetupCustom().setup_dir(PATH_APP) 
    33         # self.custom_config = _find_local_config('custom_config', c_conf_dir) 
    34         # if self.custom_config is None: 
    35         #     self.custom_config = _find_local_config('custom_config', os.getcwd()) 
    36         #     if self.custom_config is None: 
    37         #         msgConfig = "Custom_config file was not imported" 
    38         #         logging.info(msgConfig) 
    39         #     else: 
    40         #         logging.info("using custom_config in %s" % os.getcwd()) 
    41         # else: 
    42         #     logging.info("using custom_config from %s" % c_conf_dir) 
    43  
    44         # SAS_OPENCL_CUSTOM = None 
    45         # if self.custom_config.SAS_OPENCL: 
    46         #     SAS_OPENCL_CUSTOM = self.custom_config.SAS_OPENCL 
    4727 
    4828        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
     
    157137        return clinfo 
    158138 
     139    def write_to_config_file(self): 
     140        from sas.sasgui.guiframe.customdir import SetupCustom 
     141        from sas.sasgui.guiframe.gui_manager import get_app_dir, _find_local_config 
     142 
     143        PATH_APP = get_app_dir() 
     144        c_conf_dir = SetupCustom().setup_dir(PATH_APP) 
     145        self.custom_config = _find_local_config('custom_config', c_conf_dir) 
     146        if self.custom_config is None: 
     147            self.custom_config = _find_local_config('custom_config', os.getcwd()) 
     148            if self.custom_config is None: 
     149                msgConfig = "Custom_config file was not imported" 
     150                logging.info(msgConfig) 
     151            else: 
     152                logging.info("using custom_config in %s" % os.getcwd()) 
     153        else: 
     154            logging.info("using custom_config from %s" % c_conf_dir) 
     155 
     156        #How to store it in file 
     157        self.custom_config.SAS_OPENCL = self.sas_opencl 
     158 
    159159    def on_check(self, event): 
    160160        """ 
Note: See TracChangeset for help on using the changeset viewer.