Retrieve an option for the tree view. Args: parent: The cleaner ID (e.g., 'system', 'firefox') child: The option ID within the cleaner (e.g., 'cache'), or None for the cleaner itself Returns: bool: True if the option is enabled, False otherwise
(self, parent, child)
| 368 | self.__schedule_flush() |
| 369 | |
| 370 | def get_tree(self, parent, child): |
| 371 | """Retrieve an option for the tree view. |
| 372 | |
| 373 | Args: |
| 374 | parent: The cleaner ID (e.g., 'system', 'firefox') |
| 375 | child: The option ID within the cleaner (e.g., 'cache'), or None for the cleaner itself |
| 376 | |
| 377 | Returns: |
| 378 | bool: True if the option is enabled, False otherwise |
| 379 | """ |
| 380 | option = parent |
| 381 | if child is not None: |
| 382 | option += "." + child |
| 383 | |
| 384 | if not self.config.has_option('tree', option): |
| 385 | return False |
| 386 | try: |
| 387 | return self.config.getboolean('tree', option) |
| 388 | except: |
| 389 | # in case of corrupt configuration (Launchpad #799130) |
| 390 | logger.exception('Error in get_tree()') |
| 391 | return False |
| 392 | |
| 393 | def is_corrupt(self): |
| 394 | """Perform a self-check for corruption of the configuration""" |