<commit_before>import wx

_get         = None
_config      = None
_defaultFont = None
_defaults   = {
    'output_fgcolour' : '#839496',
    'output_bgcolour' : '#002b36',
    'input_fgcolour'  : '#839496',
    'input_bgcolour'  : '#002b36',

    'save_window_size' : True,
    'window_width'     : 800,
    'window_height'    : 600,
    'input_height'     : 25,

    # 'theme'        : 'solarized',

    'use_ansi'             : True,
    'use_mcp'              : True,
    'highlight_urls'       : True,
    'save_mcp_window_size' : True,
    # TODO -- make this default to False, but currently having no connection
    # at start-time breaks mainwindow
    'autoconnect_to_last'  : True,

    'mcp_window_width'  : 600,
    'mcp_window_height' : 400,

    'external_editor'  : 'gvim -f',
    #'use_x_copy_paste' : WxMOO::Utility::is_unix,
}

def Initialize():
    global _config, _defaultFont, get

    _config                  = wx.FileConfig()
    _get                     = _config.Read
    _defaultFont             = wx.Font( 12, wx.TELETYPE, wx.NORMAL, wx.NORMAL )
    _defaults['input_font']  = _defaultFont.GetNativeFontInfoDesc()
    _defaults['output_font'] = _defaultFont.GetNativeFontInfoDesc()
    for default in _defaults.items():
        (key, def_val) = default
        # if nothing exists for that key, set it to the default.
        if not get(key):
            set(key, str(def_val))

def get(val): return _config.Read(val)
def set(param, val):
    global _config

    _config.Write(param, str(val))
    _config.Flush()

<commit_msg>Get 'autoconnect_last_world' named correctly in prefs<commit_after>import wx

_get         = None
_config      = None
_defaultFont = None
_defaults   = {
    'output_fgcolour' : '#839496',
    'output_bgcolour' : '#002b36',
    'input_fgcolour'  : '#839496',
    'input_bgcolour'  : '#002b36',

    'save_window_size' : True,
    'window_width'     : 800,
    'window_height'    : 600,
    'input_height'     : 25,

    # 'theme'        : 'solarized',

    'use_ansi'             : True,
    'use_mcp'              : True,
    'highlight_urls'       : True,
    'save_mcp_window_size' : True,
    # TODO -- make this default to False, but currently having no connection
    # at start-time breaks mainwindow
    'autoconnect_last_world'  : True,

    'mcp_window_width'  : 600,
    'mcp_window_height' : 400,

    'external_editor'  : 'gvim -f',
    #'use_x_copy_paste' : WxMOO::Utility::is_unix,
}

def Initialize():
    global _config, _defaultFont, get

    _config                  = wx.FileConfig()
    _get                     = _config.Read
    _defaultFont             = wx.Font( 12, wx.TELETYPE, wx.NORMAL, wx.NORMAL )
    _defaults['input_font']  = _defaultFont.GetNativeFontInfoDesc()
    _defaults['output_font'] = _defaultFont.GetNativeFontInfoDesc()
    for default in _defaults.items():
        (key, def_val) = default
        # if nothing exists for that key, set it to the default.
        if not get(key):
            set(key, str(def_val))

def get(val): return _config.Read(val)
def set(param, val):
    global _config

    _config.Write(param, str(val))
    _config.Flush()


{'fraction_non_alphanumeric': 0.11805775944144715, 'fraction_numerical': 0.02411932719771501, 'mean_word_length': 2.441048034934498, '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': '3445440', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1066, 'n_words': 237}