(self, new_theme_name)
Create a new custom theme with the given name.

        Create the new theme based on the previously active theme
        with the current changes applied.  Once it is saved, then
        activate the new theme.

        Attributes accessed:
            builtin_name
            custom_name

        Attributes updated:
            customlist
            theme_source

        Method:
            save_new
            set_theme_type
Create a new custom theme with the given name.
Create a new custom theme with the given name .
def create_new(self, new_theme_name):
        """Create a new custom theme with the given name.

        Create the new theme based on the previously active theme
        with the current changes applied.  Once it is saved, then
        activate the new theme.

        Attributes accessed:
            builtin_name
            custom_name

        Attributes updated:
            customlist
            theme_source

        Method:
            save_new
            set_theme_type
        """
        if self.theme_source.get():
            theme_type = 'default'
            theme_name = self.builtin_name.get()
        else:
            theme_type = 'user'
            theme_name = self.custom_name.get()
        new_theme = idleConf.GetThemeDict(theme_type, theme_name)
        # Apply any of the old theme's unsaved changes to the new theme.
        if theme_name in changes['highlight']:
            theme_changes = changes['highlight'][theme_name]
            for element in theme_changes:
                new_theme[element] = theme_changes[element]
        # Save the new theme.
        self.save_new(new_theme_name, new_theme)
        # Change GUI over to the new theme.
        custom_theme_list = idleConf.GetSectionList('user', 'highlight')
        custom_theme_list.sort()
        self.customlist.SetMenu(custom_theme_list, new_theme_name)
        self.theme_source.set(0)
        self.set_theme_type()
def create_new ( self , new_theme_name ) : if self . theme_source . get ( ) : theme_type = 'default' theme_name = self . builtin_name . get ( ) else : theme_type = 'user' theme_name = self . custom_name . get ( ) new_theme = idleConf . GetThemeDict ( theme_type , theme_name ) # Apply any of the old theme's unsaved changes to the new theme. if theme_name in changes [ 'highlight' ] : theme_changes = changes [ 'highlight' ] [ theme_name ] for element in theme_changes : new_theme [ element ] = theme_changes [ element ] # Save the new theme. self . save_new ( new_theme_name , new_theme ) # Change GUI over to the new theme. custom_theme_list = idleConf . GetSectionList ( 'user' , 'highlight' ) custom_theme_list . sort ( ) self . customlist . SetMenu ( custom_theme_list , new_theme_name ) self . theme_source . set ( 0 ) self . set_theme_type ( )