@@ -303,7 +303,12 @@ def __call__(self, *args, **kwargs):
303
303
if watched is not None and scheduler is not None :
304
304
for r in watched .walk ():
305
305
if r .t is None and len (r .children ) > 0 :
306
- r .t = entitiesdescriptor (list (filter (lambda c : c is not None , [c .t for c in r .children ])), name = r .name , validate = True , filter_invalid = True )
306
+ r .t = entitiesdescriptor (
307
+ list (filter (lambda c : c is not None , [c .t for c in r .children ])),
308
+ name = r .name ,
309
+ validate = True ,
310
+ filter_invalid = True ,
311
+ )
307
312
if r .t is not None :
308
313
self .update (r .t , tid = r .name , etag = r .etag )
309
314
else :
@@ -337,22 +342,22 @@ def select(self, member, xp=None):
337
342
the metadata repository then it is fetched an treated as a list of (one per line) of selectors. If all else
338
343
fails an empty list is returned.
339
344
"""
340
- l = self ._select (member )
341
- if hasattr (l , 'tag' ):
342
- l = [l ]
343
- elif hasattr (l , '__iter__' ):
344
- l = list (l )
345
+ res = self ._select (member )
346
+ if hasattr (res , 'tag' ):
347
+ res = [res ]
348
+ elif hasattr (res , '__iter__' ):
349
+ res = list (res )
345
350
346
351
if xp is None :
347
- return l
352
+ return res
348
353
else :
349
- log .debug ("filtering %d entities using xpath %s" % (len (l ), xp ))
350
- t = entitiesdescriptor (l , 'dummy' , lookup_fn = self .lookup )
354
+ log .debug ("filtering %d entities using xpath %s" % (len (res ), xp ))
355
+ t = entitiesdescriptor (res , 'dummy' , lookup_fn = self .lookup )
351
356
if t is None :
352
357
return []
353
- l = root (t ).xpath (xp , namespaces = NS , smart_strings = False )
354
- log .debug ("got %d entities after filtering" % len (l ))
355
- return l
358
+ res = root (t ).xpath (xp , namespaces = NS , smart_strings = False )
359
+ log .debug ("got %d entities after filtering" % len (res ))
360
+ return res
356
361
357
362
def merge (self , t , nt , strategy = merge_strategies .replace_existing , strategy_name = None ):
358
363
"""
@@ -463,7 +468,7 @@ def _match(qq, elt):
463
468
m = _match (query , e )
464
469
if m is not None :
465
470
d = entity_simple_summary (e )
466
- ll = d ['title' ].lower ()
471
+ _ll = d ['title' ].lower ()
467
472
d ['matched' ] = m
468
473
else :
469
474
d = entity_simple_summary (e )
@@ -620,7 +625,7 @@ def _reindex(self):
620
625
try :
621
626
log .debug ("releasing index lock" )
622
627
lock .release ()
623
- except ThreadError as ex :
628
+ except ThreadError as _ex :
624
629
pass
625
630
626
631
def dump (self ):
0 commit comments