Set a value which is a list data type
(self, key, values)
| 482 | self.set(path_to_option(pathname), hashvalue, 'hashpath') |
| 483 | |
| 484 | def set_list(self, key, values): |
| 485 | """Set a value which is a list data type""" |
| 486 | assert isinstance(key, str), f"key must be a string: {key}" |
| 487 | section = f"list/{key}" |
| 488 | # Remove existing section first to clear old values |
| 489 | # before writing new ones. |
| 490 | if self.config.has_section(section): |
| 491 | self.config.remove_section(section) |
| 492 | self.config.add_section(section) |
| 493 | for counter, value in enumerate(values): |
| 494 | self.config.set(section, str(counter), value) |
| 495 | self.__schedule_flush() |
| 496 | |
| 497 | def set_whitelist_paths(self, values): |
| 498 | """Save the keep list (formerly whitelist)""" |