# Path: plugins/colorschemer/schemer/languages.py



import os
import sys
import collections
import tempfile
    import gettext
from xml.etree import ElementTree as ET
from gi.repository import Gtk, GdkPixbuf, Gdk, GtkSource, Gio, GLib, Pango
from .languages import samples
      
      self.liststoreStyles.clear()
      
      # remove the language namespace thing from the style name
      removeLen = len(self.selectedLanguageId) + 1
      
      thisLanguage = self.languageManager.get_language(self.selectedLanguageId)
      
      if thisLanguage != None:
      
        styleIds = thisLanguage.get_style_ids() # TODO: why is 'gtk-doc.lang' throwing a warning?
        
        styleIds.sort() # make the styles list alphabetical
        
        if self.selectedLanguageId == 'def':
          for styleId in self.guiStyleIds:
            self.liststoreStyles.append([styleId])
        
        for styleId in styleIds:
          self.liststoreStyles.append([styleId[removeLen:]])
      
      # select the first style in the list
      treeIter = self.treeviewStyles.get_model().get_iter_first()
      
      if treeIter != None:  # make sure the list is not empty since some languages have no styles
        self.treeviewStylesSelection.select_iter(treeIter)
        model = self.treeviewStyles.get_model()
        self.selectedStyleId = model[treeIter][0]
      
      # update the sample view

# Path: plugins/colorschemer/schemer/languages.py



# Path: plugins/colorschemer/schemer/schemer.py
import os
import sys
import collections
import tempfile
    import gettext
from xml.etree import ElementTree as ET
from gi.repository import Gtk, GdkPixbuf, Gdk, GtkSource, Gio, GLib, Pango
from .languages import samples

      
      self.liststoreStyles.clear()
      
      # remove the language namespace thing from the style name
      removeLen = len(self.selectedLanguageId) + 1
      
      thisLanguage = self.languageManager.get_language(self.selectedLanguageId)
      
      if thisLanguage != None:
      
        styleIds = thisLanguage.get_style_ids() # TODO: why is 'gtk-doc.lang' throwing a warning?
        
        styleIds.sort() # make the styles list alphabetical
        
        if self.selectedLanguageId == 'def':
          for styleId in self.guiStyleIds:
            self.liststoreStyles.append([styleId])
        
        for styleId in styleIds:
          self.liststoreStyles.append([styleId[removeLen:]])
      
      # select the first style in the list
      treeIter = self.treeviewStyles.get_model().get_iter_first()
      
      if treeIter != None:  # make sure the list is not empty since some languages have no styles
        self.treeviewStylesSelection.select_iter(treeIter)
        model = self.treeviewStyles.get_model()
        self.selectedStyleId = model[treeIter][0]
      
      # update the sample view

      if self.selectedLanguageId in samples: