From 01735e4c7a709f7fc87bdd37070e6fa29987a9c9 Mon Sep 17 00:00:00 2001 From: cronekorkn Date: Tue, 18 Oct 2022 15:37:46 +0200 Subject: [PATCH] style --- libs/apt.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libs/apt.py b/libs/apt.py index 74ede99..b10a094 100644 --- a/libs/apt.py +++ b/libs/apt.py @@ -11,9 +11,10 @@ class AptSource(): # parse options, which are optional if search(r'\[.*\]', string): self.options = { - k:v.split(',') for k,v in ( - e.split('=') for e in search(r'\[(.*)\]', string)[1].split() - ) + k:v.split(',') + for k,v in ( + e.split('=') for e in search(r'\[(.*)\]', string)[1].split() + ) } string_without_options = sub(r'\[.*\]', '', string) else: @@ -26,7 +27,7 @@ class AptSource(): self.url = urlparse(parts[1]) self.suite = parts[2] self.components = parts[3:] - + def __str__(self): parts = [ self.type, @@ -47,13 +48,13 @@ class AptSource(): ) ) ) - + return ' '.join(parts) - + def __eq__(self, other): return str(self) == str(other) - + def __lt__(self, other): return str(self) < str(other)