From dc8fb06110228b4fadfda4aa9ebd07ca420eec68 Mon Sep 17 00:00:00 2001 From: Simon Steuer Date: Mon, 14 Oct 2024 10:52:49 +0200 Subject: [PATCH] =?UTF-8?q?FIX=20-=20Beim=20Einlesen=20der=20Blacklist-Num?= =?UTF-8?q?mern=20ist=20es=20nun=20egal,=20ob=20der=20String=20mit=20den?= =?UTF-8?q?=20Nummern=20in=20eine=20Liste=20geschrieben=20wird=20oder=20ni?= =?UTF-8?q?cht.=20Wieso=20dies=20=C3=BCberhaupt=20passiert=20konnte=20nich?= =?UTF-8?q?t=20nachvollzogen=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/update_database.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/update_database.py b/lib/update_database.py index 33b1e93..907d117 100644 --- a/lib/update_database.py +++ b/lib/update_database.py @@ -25,13 +25,17 @@ def get_blacklist(outdir): config.read(blacklist_source_path) except configparser.DuplicateOptionError: pass + content = config.get('Settings','PartNumbersToDrop') - blacklist_str = content[0] # warum das als Liste erkannt wird wissen die Götter... - if len(blacklist_str) == 0 or len(content) == 0: + + if type(content) == list: + content = content[0] # Wird benötigt, weil der String mit den Nummern aus der Blackliste manchmal in eine Liste gepackt wird, manchmal nicht - warum wissen die Götter... + + if len(content) == 0 or len(content) == 0: print(f"import of '{blacklist_ini_filename}' from '{blacklist_net_share}' failed") exit - blacklist = blacklist_str.split(';') + blacklist = content.split(';') print("writing txt-file of blacklist ids...") outfile = os.path.join(outdir, 'blacklist.txt')