checks if the file is a valid config file
        Args:
            file_name:

def load_config(self, file_name):
        """
        checks if the file is a valid config file
        Args:
            file_name:

        """

        # load config or default if invalid

        def load_settings(file_name):
            """
            loads a old_gui settings file (a json dictionary)
            - path_to_file: path to file that contains the dictionary

            Returns:
                - instruments: depth 1 dictionary where keys are instrument names and values are instances of instruments
                - scripts:  depth 1 dictionary where keys are script names and values are instances of scripts
                - probes: depth 1 dictionary where to be decided....?
            """

            instruments_loaded = {}
            probes_loaded = {}
            scripts_loaded = {}

            if os.path.isfile(file_name):
                in_data = load_b26_file(file_name)

                instruments = in_data['instruments'] if 'instruments' in in_data else {}
                scripts = in_data['scripts'] if 'scripts' in in_data else {}
                probes = in_data['probes'] if 'probes' in in_data else {}

                instruments_loaded, failed = Instrument.load_and_append(instruments)
                if len(failed) > 0:
                    print(('WARNING! Following instruments could not be loaded: ', failed))

                scripts_loaded, failed, instruments_loaded = Script.load_and_append(
                    script_dict=scripts,
                    instruments=instruments_loaded,
                    log_function=self.log,
                    data_path=self.gui_settings['data_folder'])

                if len(failed) > 0:
                    print(('WARNING! Following scripts could not be loaded: ', failed))

                probes_loaded, failed, instruments_loadeds = Probe.load_and_append(
                    probe_dict=probes,
                    probes=probes_loaded,
                    instruments=instruments_loaded)
            return instruments_loaded, scripts_loaded, probes_loaded

        print(('loading script/instrument/probes config from {:s}'.format(file_name)))
        try:
            config = load_b26_file(file_name)['gui_settings']
            if config['settings_file'] != file_name:
                print((
                'WARNING path to settings file ({:s}) in config file is different from path of settings file ({:s})'.format(
                    config['settings_file'], file_name)))
            config['settings_file'] = file_name
            print(('loading of {:s} successful'.format(file_name)))
        except Exception:
            print(('WARNING path to settings file ({:s}) invalid use default settings'.format(file_name)))
            config = self._DEFAULT_CONFIG


            for x in list(self._DEFAULT_CONFIG.keys()):
                if x in config:
                    if not os.path.exists(config[x]):
                        try:
                            os.makedirs(config[x])
                        except Exception:
                            config[x] = self._DEFAULT_CONFIG[x]
                            os.makedirs(config[x])
                            print(('WARNING: failed validating or creating path: set to default path'.format(config[x])))
                else:
                    config[x] = self._DEFAULT_CONFIG[x]
                    os.makedirs(config[x])
                    print(('WARNING: path {:s} not specified set to default {:s}'.format(x, config[x])))

        # check if file_name is a valid filename
        if os.path.exists(os.path.dirname(file_name)):
            config['settings_file'] = file_name

        self.gui_settings = config

        self.instruments, self.scripts, self.probes = load_settings(file_name)


        self.refresh_tree(self.tree_gui_settings, self.gui_settings)
        self.refresh_tree(self.tree_scripts, self.scripts)
        self.refresh_tree(self.tree_settings, self.instruments)

        self._hide_parameters(file_name)