# Path: lcopt/data_store.py
# class LcoptStorage():
#     def __init__(self):
#     def load_config(self):
#     def refresh(self):
#     def write_default_config(self):
#     def write_config(self, config):
#     def models(self):
#     def search_indices(self):
#     def project_type(self):
#     def single_project_name(self):
#     def ecoinvent_version(self):
#     def ecoinvent_system_model(self):
#     def save_option(self):


from .data_store import storage
        from .settings_gui import FlaskSettingsGUI
import yaml
import types
    def as_dict(self):
        d = {}
        for k in self._sections:
            d[k] = getattr(self, k).as_dict()
        return d

    def __repr__(self):

        string = ""

        for section, content in self.as_dict().items():
            string += "{}:\n".format(section)
            for k, v in content.items():
                string += "\t{}: {}\n".format(k,v)

        return "Lcopt settings: \n\n{}".format(string)

    def refresh(self, **kwargs):

        self.config = storage.load_config()

        self._sections = []

        for section, content in self.config.items():
            setattr(self, section, SettingsDict(content, self.write, **kwargs))
            self._sections.append(section)


    def write(self):
        """write the current settings to the config file"""

# Path: lcopt/data_store.py
# class LcoptStorage():
#     def __init__(self):
#     def load_config(self):
#     def refresh(self):
#     def write_default_config(self):
#     def write_config(self, config):
#     def models(self):
#     def search_indices(self):
#     def project_type(self):
#     def single_project_name(self):
#     def ecoinvent_version(self):
#     def ecoinvent_system_model(self):
#     def save_option(self):


# Path: lcopt/settings.py
from .data_store import storage
        from .settings_gui import FlaskSettingsGUI
import yaml
import types

    def as_dict(self):
        d = {}
        for k in self._sections:
            d[k] = getattr(self, k).as_dict()
        return d

    def __repr__(self):

        string = ""

        for section, content in self.as_dict().items():
            string += "{}:\n".format(section)
            for k, v in content.items():
                string += "\t{}: {}\n".format(k,v)

        return "Lcopt settings: \n\n{}".format(string)

    def refresh(self, **kwargs):

        self.config = storage.load_config()

        self._sections = []

        for section, content in self.config.items():
            setattr(self, section, SettingsDict(content, self.write, **kwargs))
            self._sections.append(section)


    def write(self):
        """write the current settings to the config file"""

        with open(storage.config_file, 'w') as cfg: