Example #1
0
    def config(self):

        ct.ini_write(fn_config, "op", "color_comma", option_color_comma)
        ct.ini_write(fn_config, "op", "colors_fixed", option_colors_fixed)
        ct.ini_write(fn_config, "op", "colors_themed", option_colors_themed)
        ct.ini_write(fn_config, "op", "use_theme_colors", bool_to_str(option_use_theme_colors))
        ct.ini_write(fn_config, "op", "separator", option_separator)
        ct.file_open(fn_config)
Example #2
0
def select_env():
    items = list(jedi.find_system_environments())
    names = [repr(i).replace('Environment:', 'Python') for i in items]
    names.append('Other...')
    i = ct.dlg_menu(ct.MENU_LIST, names, caption='Select Python interpreter')
    if i is None:
        return
    elif i == len(names) - 1:
        filters = 'Executables|*.exe' if IS_NT else ''
        fn = ct.dlg_file(True, '!', '', filters)
        if not fn:
            return
    else:
        fn = items[i].executable
    env = create_env(fn)
    if env:
        ct.ini_write(cfg_file, cfg_section, cfg_opt_env, fn)
        return env
Example #3
0
def do_options_save():
    global color_error
    global color_warn
    global color_info
    global color_error_use
    global color_warn_use
    global color_info_use
    global use_on_open
    global use_on_save
    global use_on_change

    app.ini_write(fn_ini, 'colors', 'error', int_to_html(color_error))
    app.ini_write(fn_ini, 'colors', 'warn', int_to_html(color_warn))
    app.ini_write(fn_ini, 'colors', 'info', int_to_html(color_info))

    app.ini_write(fn_ini, 'colors', 'error_use', str(int(color_error_use)))
    app.ini_write(fn_ini, 'colors', 'warn_use', str(int(color_warn_use)))
    app.ini_write(fn_ini, 'colors', 'info_use', str(int(color_info_use)))

    app.ini_write(fn_ini, 'events', 'on_open', str(int(use_on_open)))
    app.ini_write(fn_ini, 'events', 'on_save', str(int(use_on_save)))
    app.ini_write(fn_ini, 'events', 'on_change', str(int(use_on_change)))

    do_options_apply()
Example #4
0
 def config(self):
     ct.ini_write(cfg_file, cfg_section, cfg_opt_menu_w, str(opt_menu_w))
     ct.ini_write(cfg_file, cfg_section, cfg_opt_menu_h, str(opt_menu_h))
     ct.file_open(cfg_file)
def do_save_ops():
  app.ini_write(fn_ini, 'op', 'min_len', str(opt.MIN_LEN))
  app.ini_write(fn_ini, 'op', 'max_lines', str(opt.MAX_LINES))
  app.ini_write(fn_ini, 'op', 'use_nearest_line_count', str(opt.USE_NEAREST_LINE_COUNT))

  app.ini_write(fn_ini, 'op', 'sel_allow', bool_to_str(opt.SEL_ALLOW))
  app.ini_write(fn_ini, 'op', 'sel_allow_white_space', bool_to_str(opt.SEL_ALLOW_WHITE_SPACE))
  app.ini_write(fn_ini, 'op', 'sel_case_sensitive', bool_to_str(opt.SEL_CASE_SENSITIVE))
  app.ini_write(fn_ini, 'op', 'sel_words_only', bool_to_str(opt.SEL_WORDS_ONLY))
  app.ini_write(fn_ini, 'op', 'sel_whole_words', bool_to_str(opt.SEL_WHOLE_WORDS))

  app.ini_write(fn_ini, 'op', 'caret_allow', bool_to_str(opt.CARET_ALLOW))
  app.ini_write(fn_ini, 'op', 'caret_case_sensitive', bool_to_str(opt.CARET_CASE_SENSITIVE))
  app.ini_write(fn_ini, 'op', 'caret_whole_words', bool_to_str(opt.CARET_WHOLE_WORDS))

  app.ini_write(fn_ini, 'colors', 'font_other', appx.int_to_html_color(opt.COLOR_FONT_OTHER))
  app.ini_write(fn_ini, 'colors', 'bg_other', appx.int_to_html_color(opt.COLOR_BG_OTHER))
  app.ini_write(fn_ini, 'colors', 'font_current', appx.int_to_html_color(opt.COLOR_FONT_CURRENT))
  app.ini_write(fn_ini, 'colors', 'bg_current', appx.int_to_html_color(opt.COLOR_BG_CURRENT))
Example #6
0
 def write_int(self, section, key, value):
     """Write single string to .ini file"""
     ct.ini_write(self.file, section, key, str(value))
Example #7
0
def do_options_save():
    global color_error
    global color_warn
    global color_info
    global color_error_use
    global color_warn_use
    global color_info_use
    global use_on_open
    global use_on_save
    global use_on_change

    app.ini_write(fn_ini, 'colors', 'error', int_to_html(color_error))
    app.ini_write(fn_ini, 'colors', 'warn', int_to_html(color_warn))
    app.ini_write(fn_ini, 'colors', 'info', int_to_html(color_info))

    app.ini_write(fn_ini, 'colors', 'error_use', str(int(color_error_use)))
    app.ini_write(fn_ini, 'colors', 'warn_use', str(int(color_warn_use)))
    app.ini_write(fn_ini, 'colors', 'info_use', str(int(color_info_use)))

    app.ini_write(fn_ini, 'events', 'on_open', str(int(use_on_open)))
    app.ini_write(fn_ini, 'events', 'on_save', str(int(use_on_save)))
    app.ini_write(fn_ini, 'events', 'on_change', str(int(use_on_change)))

    do_options_apply()
Example #8
0
def do_save_ops():
  app.ini_write(fn_ini, 'op', 'min_len', str(MIN_LEN))
  
  app.ini_write(fn_ini, 'op', 'sel_allow', bool_str(SEL_ALLOW))
  app.ini_write(fn_ini, 'op', 'sel_allow_white_space', bool_str(SEL_ALLOW_WHITE_SPACE))
  app.ini_write(fn_ini, 'op', 'sel_case_sensitive', bool_str(SEL_CASE_SENSITIVE))
  app.ini_write(fn_ini, 'op', 'sel_words_only', bool_str(SEL_WORDS_ONLY))
  app.ini_write(fn_ini, 'op', 'sel_whole_words', bool_str(SEL_WHOLE_WORDS))
  
  app.ini_write(fn_ini, 'op', 'caret_allow', bool_str(CARET_ALLOW))
  app.ini_write(fn_ini, 'op', 'caret_case_sensitive', bool_str(CARET_CASE_SENSITIVE))
  app.ini_write(fn_ini, 'op', 'caret_whole_words', bool_str(CARET_WHOLE_WORDS))
  
  app.ini_write(fn_ini, 'colors', 'font_other', int_to_html(COLOR_FONT_OTHER))
  app.ini_write(fn_ini, 'colors', 'bg_other', int_to_html(COLOR_BG_OTHER))
  app.ini_write(fn_ini, 'colors', 'font_current', int_to_html(COLOR_FONT_CURRENT))
  app.ini_write(fn_ini, 'colors', 'bg_current', int_to_html(COLOR_BG_CURRENT))
Example #9
0
 def save(self):
     ct.ini_proc(ct.INI_DELETE_SECTION, self.filename, self.section, '')
     for (i, item) in enumerate(self.items):
         ct.ini_write(self.filename, self.section, str(i), item)