Esempio n. 1
0
 def _read_region(self, region):
     section = 'region_%s' % Region.values()[region.id].lower()
     if self._config.has_section(section):
         color_name = self._config.get(section, 'color')
         if color_name is not None:
             region.color = Color.names()[color_name]
         level_name = self._config.get(section, 'level')
         if level_name is not None:
             region.level = Level.names()[level_name]
Esempio n. 2
0
 def _read_region(self, region):
     section = "region_%s" % Region.values()[region.id].lower()
     if self._config.has_section(section):
         color_name = self._config.get(section, "color")
         if color_name is not None:
             region.color = Color.names()[color_name]
         level_name = self._config.get(section, "level")
         if level_name is not None:
             region.level = Level.names()[level_name]
Esempio n. 3
0
 def _write_region(self, region):
     section = 'region_%s' % Region.values()[region.id].lower()
     if not self._config.has_section(section):
         self._config.add_section(section)
     self._config.set(section, 'color', Color.values()[region.color])
     self._config.set(section, 'level', Level.values()[region.level])
Esempio n. 4
0
 def _write_region(self, region):
     section = "region_%s" % Region.values()[region.id].lower()
     if not self._config.has_section(section):
         self._config.add_section(section)
     self._config.set(section, "color", Color.values()[region.color])
     self._config.set(section, "level", Level.values()[region.level])