[lfs] Add options with comments for update opt-out to config

This commit is contained in:
derrod 2021-09-03 20:11:11 +02:00
parent 315bdfb4a4
commit 5fe35c7008

View file

@ -77,7 +77,15 @@ class LGDLFS:
# make sure "Legendary" section exists # make sure "Legendary" section exists
if 'Legendary' not in self.config: if 'Legendary' not in self.config:
self.config['Legendary'] = dict() self.config.add_section('Legendary')
# Add opt-out options with explainers
if not self.config.has_option('Legendary', 'disable_update_check'):
self.config.set('Legendary', '; Disables the automatic update check')
self.config.set('Legendary', 'disable_update_check', 'false')
if not self.config.has_option('Legendary', 'disable_update_notice'):
self.config.set('Legendary', '; Disables the notice about an available update on exit')
self.config.set('Legendary', 'disable_update_notice', 'false' if os.name == 'nt' else 'true')
try: try:
self._installed = json.load(open(os.path.join(self.path, 'installed.json'))) self._installed = json.load(open(os.path.join(self.path, 'installed.json')))