Lines Matching refs:section

11 database keys are tuples (config-type, section, item).  As implemented,
14 value for each key is a ConfigParser instance that maps section and item
50 def Get(self, section, option, type=None, default=None, raw=False):
52 Get an option value for given section/option or return default.
56 # Should also print Warning(file, section, option).
58 if not self.has_option(section, option):
61 return self.getboolean(section, option)
63 return self.getint(section, option)
65 return self.get(section, option, raw=raw)
67 def GetOptionList(self, section):
68 "Return a list of options for given section, else []."
69 if self.has_section(section):
70 return self.options(section)
84 def SetOption(self, section, option, value):
87 Add section if required. False means option already had value.
89 if self.has_option(section, option):
90 if self.get(section, option) == value:
93 self.set(section, option, value)
96 if not self.has_section(section):
97 self.add_section(section)
98 self.set(section, option, value)
101 def RemoveOption(self, section, option):
102 """Return True if option is removed from section, else False.
104 False if either section does not exist or did not have option.
106 if self.has_section(section):
107 return self.remove_option(section, option)
110 def AddSection(self, section):
111 "If section doesn't exist, add it."
112 if not self.has_section(section):
113 self.add_section(section)
117 for section in self.sections():
118 if not self.GetOptionList(section):
119 self.remove_section(section)
214 def GetOption(self, configType, section, option, default=None, type=None,
216 """Return a value for configType section option, or default.
228 if self.userCfg[configType].has_option(section, option):
229 return self.userCfg[configType].Get(section, option,
234 ' from section %r: %r' %
235 (type, option, section,
236 self.userCfg[configType].Get(section, option, raw=raw)))
237 _warn(warning, configType, section, option)
239 if self.defaultCfg[configType].has_option(section,option):
241 section, option, type=type, raw=raw)
248 ' from section %r.\n'
250 (option, section, default))
251 _warn(warning, configType, section, option)
254 def SetOption(self, configType, section, option, value):
255 """Set section option to value in user config file."""
256 self.userCfg[configType].SetOption(section, option, value)
365 def current_colors_and_keys(self, section):
366 """Return the currently active name for Theme or Keys section.
389 cfgname = 'highlight' if section == 'Theme' else 'keys'
390 default = self.GetOption('main', section, 'default',
394 name = self.GetOption('main', section, 'name2', default='')
396 name = self.GetOption('main', section, 'name', default='')
401 return "IDLE Classic" if section == 'Theme' else self.default_keys()
454 "Return extnNameList with keybinding section names removed."
474 Events come from default config extension_cfgBindings section.
492 Events come from default config extension_cfgBindings section.
530 keySetName - name of key binding set (config-keys section).
728 def GetFont(self, root, configType, section):
739 family = self.GetOption(configType, section, 'font', default='courier')
740 size = self.GetOption(configType, section, 'font-size', type='int',
742 bold = self.GetOption(configType, section, 'font-bold', default=0,
786 section -- a section within a page/file.
787 option -- name of an option within a section.
794 delete_section: If section exists,
805 def add_option(self, config_type, section, item, value):
806 "Add item/value pair for config_type and section."
809 if section not in page:
810 page[section] = {}
811 page[section][item] = value
814 def save_option(config_type, section, item, value):
819 if idleConf.defaultCfg[config_type].has_option(section, item):
820 if idleConf.defaultCfg[config_type].Get(section, item) == value:
822 return idleConf.userCfg[config_type].RemoveOption(section, item)
824 return idleConf.userCfg[config_type].SetOption(section, item, value)
838 for section in page:
839 if section == 'HelpFiles': # Remove it for replacement.
842 for item, value in page[section].items():
843 if self.save_option(config_type, section, item, value):
856 def delete_section(self, config_type, section):
857 """Delete a section from self, userCfg, and file.
861 if section in self[config_type]:
862 del self[config_type][section]
864 configpage.remove_section(section)
896 for section in sections:
897 options = cfg[key].options(section)
898 sprint(section)
901 sprint(option + ' = ' + cfg[key].Get(section, option))