(self, type, themeName)
return theme
Return {option:value} dict for elements in themeName.

        type - string, 'default' or 'user' theme type
        themeName - string, theme name
        Values are loaded over ultimate fallback defaults to guarantee
        that all theme elements are present in a newly created theme.
Return {option:value} dict for elements in themeName.
Return { option : value } dict for elements in themeName .
def GetThemeDict(self, type, themeName):
        """Return {option:value} dict for elements in themeName.

        type - string, 'default' or 'user' theme type
        themeName - string, theme name
        Values are loaded over ultimate fallback defaults to guarantee
        that all theme elements are present in a newly created theme.
        """
        if type == 'user':
            cfgParser = self.userCfg['highlight']
        elif type == 'default':
            cfgParser = self.defaultCfg['highlight']
        else:
            raise InvalidTheme('Invalid theme type specified')
        # Provide foreground and background colors for each theme
        # element (other than cursor) even though some values are not
        # yet used by idle, to allow for their use in the future.
        # Default values are generally black and white.
        # TODO copy theme from a class attribute.
        theme ={'normal-foreground':'#000000',
                'normal-background':'#ffffff',
                'keyword-foreground':'#000000',
                'keyword-background':'#ffffff',
                'builtin-foreground':'#000000',
                'builtin-background':'#ffffff',
                'comment-foreground':'#000000',
                'comment-background':'#ffffff',
                'string-foreground':'#000000',
                'string-background':'#ffffff',
                'definition-foreground':'#000000',
                'definition-background':'#ffffff',
                'hilite-foreground':'#000000',
                'hilite-background':'gray',
                'break-foreground':'#ffffff',
                'break-background':'#000000',
                'hit-foreground':'#ffffff',
                'hit-background':'#000000',
                'error-foreground':'#ffffff',
                'error-background':'#000000',
                'context-foreground':'#000000',
                'context-background':'#ffffff',
                'linenumber-foreground':'#000000',
                'linenumber-background':'#ffffff',
                #cursor (only foreground can be set)
                'cursor-foreground':'#000000',
                #shell window
                'stdout-foreground':'#000000',
                'stdout-background':'#ffffff',
                'stderr-foreground':'#000000',
                'stderr-background':'#ffffff',
                'console-foreground':'#000000',
                'console-background':'#ffffff',
                }
        for element in theme:
            if not (cfgParser.has_option(themeName, element) or
                    # Skip warning for new elements.
                    element.startswith(('context-', 'linenumber-'))):
                # Print warning that will return a default color
                warning = ('\n Warning: config.IdleConf.GetThemeDict'
                           ' -\n problem retrieving theme element %r'
                           '\n from theme %r.\n'
                           ' returning default color: %r' %
                           (element, themeName, theme[element]))
                _warn(warning, 'highlight', themeName, element)
            theme[element] = cfgParser.Get(
                    themeName, element, default=theme[element])
        return theme
def GetThemeDict ( self , type , themeName ) : if type == 'user' : cfgParser = self . userCfg [ 'highlight' ] elif type == 'default' : cfgParser = self . defaultCfg [ 'highlight' ] else : raise InvalidTheme ( 'Invalid theme type specified' ) # Provide foreground and background colors for each theme # element (other than cursor) even though some values are not # yet used by idle, to allow for their use in the future. # Default values are generally black and white. # TODO copy theme from a class attribute. theme = { 'normal-foreground' : '#000000' , 'normal-background' : '#ffffff' , 'keyword-foreground' : '#000000' , 'keyword-background' : '#ffffff' , 'builtin-foreground' : '#000000' , 'builtin-background' : '#ffffff' , 'comment-foreground' : '#000000' , 'comment-background' : '#ffffff' , 'string-foreground' : '#000000' , 'string-background' : '#ffffff' , 'definition-foreground' : '#000000' , 'definition-background' : '#ffffff' , 'hilite-foreground' : '#000000' , 'hilite-background' : 'gray' , 'break-foreground' : '#ffffff' , 'break-background' : '#000000' , 'hit-foreground' : '#ffffff' , 'hit-background' : '#000000' , 'error-foreground' : '#ffffff' , 'error-background' : '#000000' , 'context-foreground' : '#000000' , 'context-background' : '#ffffff' , 'linenumber-foreground' : '#000000' , 'linenumber-background' : '#ffffff' , #cursor (only foreground can be set) 'cursor-foreground' : '#000000' , #shell window 'stdout-foreground' : '#000000' , 'stdout-background' : '#ffffff' , 'stderr-foreground' : '#000000' , 'stderr-background' : '#ffffff' , 'console-foreground' : '#000000' , 'console-background' : '#ffffff' , } for element in theme : if not ( cfgParser . has_option ( themeName , element ) or # Skip warning for new elements. element . startswith ( ( 'context-' , 'linenumber-' ) ) ) : # Print warning that will return a default color warning = ( '\n Warning: config.IdleConf.GetThemeDict' ' -\n problem retrieving theme element %r' '\n from theme %r.\n' ' returning default color: %r' % ( element , themeName , theme [ element ] ) ) _warn ( warning , 'highlight' , themeName , element ) theme [ element ] = cfgParser . Get ( themeName , element , default = theme [ element ] ) return theme