From 7687a572797426090ac95309424afbe6a7c6971d Mon Sep 17 00:00:00 2001 From: papajoker Date: Sun, 24 Nov 2019 16:26:25 +0100 Subject: [PATCH] simplify code --- src/manjaro_hello.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/manjaro_hello.py b/src/manjaro_hello.py index e4b229a..0837857 100644 --- a/src/manjaro_hello.py +++ b/src/manjaro_hello.py @@ -333,12 +333,10 @@ def get_lsb_infos(): for line in lsb_release: if "=" in line: var, arg = line.rstrip().split("=") - if var.startswith("DISTRIB_"): - var = var[8:] - if arg.startswith("\"") and arg.endswith("\""): - arg = arg[1:-1] - if arg: - lsb[var] = arg + if not arg: + continue + var = var.replace("DISTRIB_","") + lsb[var] = arg.strip('"') except (OSError, KeyError) as error: print(error) return 'not Manjaro', '0.0'