def load_settings(self): settings = ConfigParser.ConfigParser() # Fill defaults settings.add_section("main") settings.set("main", "save-before-build", "True") settings.set("main", "ptp-debug", "False") filename = self.get_settings_filename() if os.path.isfile(filename): with open(filename, "r") as f: settings.readfp(f) return settings
def add_source(bot, update, args): if args: section = add_section(*args) info = 'Источник {0[0]} был добавлен.'.format(section) update.message.reply_text(info) else: update.message.reply_text(messages.ADD, parse_mode='Markdown')
def load_settings(self): settings = ConfigParser.ConfigParser() # Fill defaults settings.add_section("main") settings.add_section("code_completion") settings.set("main", "save-before-build", "True") settings.set("main", "ptp-debug", "False") settings.set("code_completion","enable_highlight_current_line","True") settings.set("code_completion", "enable_show_line_numbers", "True") settings.set("code_completion", "tab_width", "4") settings.set("code_completion","enable_info_box","True") settings.set("code_completion", "delay_info_box", "250.0") filename = self.get_settings_filename() if os.path.isfile(filename): with open(filename, "r") as f: settings.readfp(f) return settings