From 5fe35c70080788716042bf6297ca6ffbc2c54e08 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 3 Sep 2021 20:11:11 +0200 Subject: [PATCH] [lfs] Add options with comments for update opt-out to config --- legendary/lfs/lgndry.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 6c003a0..b360c75 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -77,7 +77,15 @@ class LGDLFS: # make sure "Legendary" section exists 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: self._installed = json.load(open(os.path.join(self.path, 'installed.json')))