MCPcopy Index your code
hub / github.com/python/cpython / GetHighlight

Method GetHighlight

Lib/idlelib/config.py:275–288  ·  view source on GitHub ↗

Return dict of theme element highlight colors. The keys are 'foreground' and 'background'. The values are tkinter color strings for configuring backgrounds and tags.

(self, theme, element)

Source from the content-addressed store, hash-verified

273 return cfgParser.sections()
274
275 def GetHighlight(self, theme, element):
276 """Return dict of theme element highlight colors.
277
278 The keys are 'foreground' and 'background'. The values are
279 tkinter color strings for configuring backgrounds and tags.
280 """
281 cfg = ('default' if self.defaultCfg['highlight'].has_section(theme)
282 else 'user')
283 theme_dict = self.GetThemeDict(cfg, theme)
284 fore = theme_dict[element + '-foreground']
285 if element == 'cursor':
286 element = 'normal'
287 back = theme_dict[element + '-background']
288 return {"foreground": fore, "background": back}
289
290 def GetThemeDict(self, type, themeName):
291 """Return {option:value} dict for elements in themeName.

Callers 14

color_breakpoint_textMethod · 0.80
remote_stack_viewerMethod · 0.80
ResetColorizerMethod · 0.80
paint_theme_sampleMethod · 0.80
update_colorsMethod · 0.80
update_colorsMethod · 0.80
drawtextMethod · 0.80
color_configFunction · 0.80
LoadTagDefsMethod · 0.80
reloadMethod · 0.80

Calls 2

GetThemeDictMethod · 0.95
has_sectionMethod · 0.80

Tested by 1

test_get_highlightMethod · 0.64