<commit_before>from kao_config import GlobalConfigFile
from kao_decorators import lazy_property

class Config:
    """ Represents the DevLog Configuration """
    CONFIG_FILENAME = ".devlog"
    
    @lazy_property
    def config(self):
        """ Return the Config object """
        return GlobalConfigFile(self.CONFIG_FILENAME, create=True)
        
    @property
    def editorCommandString(self):
        """ Return the configured editor command String """
        return self.config.readlines()[0].strip()
        
    def setEditor(self, editorCmd):
        """ Set the editor command """
        self.config.write(editorCmd.strip())
        
Config = Config()<commit_msg>Updated config to store its values via TOML<commit_after>from kao_config import GlobalConfigFile
from kao_decorators import lazy_property

import toml

class Config:
    """ Represents the DevLog Configuration """
    CONFIG_FILENAME = ".devlog"
    EDITOR_KEY = 'editor'
    
    @lazy_property
    def config(self):
        """ Return the Config object """
        return GlobalConfigFile(self.CONFIG_FILENAME, create=True)
        
    @property
    def editorCommandString(self):
        """ Return the configured editor command String """
        return self._toml[self.EDITOR_KEY]
        
    def setEditor(self, editorCmd):
        """ Set the editor command """
        self._write(editor=editorCmd.strip())
        
    @property
    def _toml(self):
        """ Return the toml dictionary from the file """
        return toml.loads(self.config.read())
        
    def _write(self, **kwargs):
        """ Write the configuration with the data given """
        self.config.write(toml.dumps(kwargs))
        
Config = Config()
{'fraction_non_alphanumeric': 0.09599096555618294, 'fraction_numerical': 0.000564652738565782, 'mean_word_length': 2.467710371819961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '776279', 'n_tokens_mistral': 498, 'n_tokens_neox': 463, 'n_words': 127}