MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / set_list

Method set_list

bleachbit/Options.py:484–495  ·  view source on GitHub ↗

Set a value which is a list data type

(self, key, values)

Source from the content-addressed store, hash-verified

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

Callers 6

restoreMethod · 0.95
test_OptionsMethod · 0.80
add_drive_cbMethod · 0.80
remove_drive_cbMethod · 0.80

Calls 3

__schedule_flushMethod · 0.95
add_sectionMethod · 0.80
setMethod · 0.45