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]
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]
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])
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])