Set a general option
(self, key, value, section='bleachbit')
| 450 | self.set("version", bleachbit.APP_VERSION) |
| 451 | |
| 452 | def set(self, key, value, section='bleachbit'): |
| 453 | """Set a general option""" |
| 454 | assert isinstance(key, str), f"key must be a string: {key}" |
| 455 | assert isinstance(section, str), f"section must be a string: {section}" |
| 456 | override_key = (section, key) |
| 457 | if override_key not in self.overrides: |
| 458 | value = str(value) |
| 459 | if self.config.has_option(section, key) and self.config.get(section, key) == value: |
| 460 | return |
| 461 | self.config.set(section, key, value) |
| 462 | self.__schedule_flush() |
| 463 | |
| 464 | def commit(self): |
| 465 | """Cancel times and write changes""" |