@@ -162,9 +162,7 @@ def __init__(self, key, doc):
162
162
self .key = key
163
163
self .__doc__ = doc
164
164
165
- def __get__ (
166
- self , obj , objtype = None
167
- ):
165
+ def __get__ (self , obj , objtype = None ):
168
166
if obj is None :
169
167
return self
170
168
return obj .section .get (self .key , None )
@@ -181,9 +179,7 @@ def __init__(self, key, doc):
181
179
self .key = key
182
180
self .__doc__ = doc
183
181
184
- def __get__ (
185
- self , obj , objtype = None
186
- ):
182
+ def __get__ (self , obj , objtype = None ):
187
183
if obj is None :
188
184
return self
189
185
return SourceEntry .mysplit (obj .section .get (self .key , "" ))
@@ -199,7 +195,7 @@ def __init__(self, parent):
199
195
def __get__ (
200
196
self ,
201
197
obj ,
202
- objtype = None ,
198
+ objtype = None ,
203
199
):
204
200
if obj is None :
205
201
return self
@@ -224,7 +220,7 @@ def __init__(
224
220
self ,
225
221
section ,
226
222
file ,
227
- list = None ,
223
+ list = None ,
228
224
):
229
225
if section is None :
230
226
self .section = Section ("" )
@@ -344,8 +340,7 @@ def merge(self, other):
344
340
if not isinstance (other , Deb822SourceEntry ):
345
341
return False
346
342
if self .comment != other .comment and not any (
347
- "Added by software-properties" in c
348
- for c in (self .comment , other .comment )
343
+ "Added by software-properties" in c for c in (self .comment , other .comment )
349
344
):
350
345
return False
351
346
@@ -564,7 +559,7 @@ def file(self):
564
559
class SourceEntry :
565
560
"""single sources.list entry"""
566
561
567
- def __init__ (self , line , file = None ):
562
+ def __init__ (self , line , file = None ):
568
563
self .invalid = False # is the source entry valid
569
564
self .disabled = False # is it disabled ('#' in front)
570
565
self .type = "" # what type (deb, deb-src)
@@ -579,9 +574,7 @@ def __init__(self, line, file = None):
579
574
if file is None :
580
575
file = _APT_SOURCES_LIST
581
576
if file .endswith (".sources" ):
582
- raise ValueError (
583
- "Classic SourceEntry cannot be written to .sources file"
584
- )
577
+ raise ValueError ("Classic SourceEntry cannot be written to .sources file" )
585
578
self .file = file # the file that the entry is located in
586
579
self ._parse_sources (line )
587
580
self .template = None # type DistInfo.Suite
@@ -778,9 +771,7 @@ def __iter__(self):
778
771
types"""
779
772
yield from self .list
780
773
781
- def __find (
782
- self , * predicates , ** attrs
783
- ):
774
+ def __find (self , * predicates , ** attrs ):
784
775
uri = attrs .pop ("uri" , None )
785
776
for source in self .exploded_list ():
786
777
if uri and source .uri and uri .rstrip ("/" ) != source .uri .rstrip ("/" ):
@@ -910,9 +901,7 @@ def load(self, file):
910
901
with open (file ) as f :
911
902
if file .endswith (".sources" ):
912
903
for section in File (f ):
913
- self .list .append (
914
- Deb822SourceEntry (section , file , list = self )
915
- )
904
+ self .list .append (Deb822SourceEntry (section , file , list = self ))
916
905
else :
917
906
for line in f :
918
907
source = SourceEntry (line , file )
@@ -996,9 +985,7 @@ def exploded_list(self):
996
985
for typ in entry .types :
997
986
for uri in entry .uris :
998
987
for sui in entry .suites :
999
- res .append (
1000
- ExplodedDeb822SourceEntry (entry , typ , uri , sui )
1001
- )
988
+ res .append (ExplodedDeb822SourceEntry (entry , typ , uri , sui ))
1002
989
1003
990
return res
1004
991
0 commit comments