From 346053831bd951d5da47ec5ff488783c058cfa03 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Thu, 20 Jun 2024 13:51:45 +0200 Subject: [PATCH] Assign the STATE_FILE var before it is accessed in arch-update-tray.py script (#174) This is to address pylint [E0606](https://pylint.pycqa.org/en/latest/user_guide/messages/error/possibly-used-before-assignment.html) warning in CI. --- po/arch-update.pot | 4 ++-- po/fr.po | 4 ++-- src/script/arch-update-tray.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/po/arch-update.pot b/po/arch-update.pot index 8f1df6f..cbf513f 100644 --- a/po/arch-update.pot +++ b/po/arch-update.pot @@ -463,10 +463,10 @@ msgstr "" msgid "The '${config_file}' configuration file has been generated" msgstr "" -#: src/script/arch-update-tray.py:117 +#: src/script/arch-update-tray.py:118 msgid "Run Arch-Update" msgstr "" -#: src/script/arch-update-tray.py:118 +#: src/script/arch-update-tray.py:119 msgid "Exit" msgstr "" diff --git a/po/fr.po b/po/fr.po index 342990a..5b2a298 100644 --- a/po/fr.po +++ b/po/fr.po @@ -497,10 +497,10 @@ msgstr "" msgid "The '${config_file}' configuration file has been generated" msgstr "Le fichier de configuration '${config_file}' a été généré" -#: src/script/arch-update-tray.py:117 +#: src/script/arch-update-tray.py:118 msgid "Run Arch-Update" msgstr "Lancer Arch-Update" -#: src/script/arch-update-tray.py:118 +#: src/script/arch-update-tray.py:119 msgid "Exit" msgstr "Quitter" diff --git a/src/script/arch-update-tray.py b/src/script/arch-update-tray.py index 16ea7d1..41f13be 100755 --- a/src/script/arch-update-tray.py +++ b/src/script/arch-update-tray.py @@ -13,6 +13,7 @@ log = logging.getLogger(__name__) # Find Statefile +STATE_FILE = None if 'XDG_STATE_HOME' in os.environ: STATE_FILE = os.path.join( os.environ['XDG_STATE_HOME'], 'arch-update', 'current_state')