mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:56:02 -04:00
Fix flake8 warnings for new flake8
This commit is contained in:
parent
43e13dbd4d
commit
d83d004ccd
34 changed files with 74 additions and 67 deletions
|
@ -46,7 +46,7 @@ class Clock(object):
|
|||
|
||||
def looping_call(self, f, msec):
|
||||
l = task.LoopingCall(f)
|
||||
l.start(msec/1000.0, now=False)
|
||||
l.start(msec / 1000.0, now=False)
|
||||
return l
|
||||
|
||||
def stop_looping_call(self, loop):
|
||||
|
|
|
@ -149,7 +149,7 @@ class CacheDescriptor(object):
|
|||
self.lru = lru
|
||||
self.tree = tree
|
||||
|
||||
self.arg_names = inspect.getargspec(orig).args[1:num_args+1]
|
||||
self.arg_names = inspect.getargspec(orig).args[1:num_args + 1]
|
||||
|
||||
if len(self.arg_names) < self.num_args:
|
||||
raise Exception(
|
||||
|
@ -250,7 +250,7 @@ class CacheListDescriptor(object):
|
|||
self.num_args = num_args
|
||||
self.list_name = list_name
|
||||
|
||||
self.arg_names = inspect.getargspec(orig).args[1:num_args+1]
|
||||
self.arg_names = inspect.getargspec(orig).args[1:num_args + 1]
|
||||
self.list_pos = self.arg_names.index(self.list_name)
|
||||
|
||||
self.cache = cache
|
||||
|
|
|
@ -55,7 +55,7 @@ class ExpiringCache(object):
|
|||
def f():
|
||||
self._prune_cache()
|
||||
|
||||
self._clock.looping_call(f, self._expiry_ms/2)
|
||||
self._clock.looping_call(f, self._expiry_ms / 2)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
now = self._clock.time_msec()
|
||||
|
|
|
@ -58,7 +58,7 @@ class TreeCache(object):
|
|||
|
||||
if n:
|
||||
break
|
||||
node_and_keys[i+1][0].pop(k)
|
||||
node_and_keys[i + 1][0].pop(k)
|
||||
|
||||
popped, cnt = _strip_and_count_entires(popped)
|
||||
self.size -= cnt
|
||||
|
|
|
@ -111,7 +111,7 @@ def time_function(f):
|
|||
_log_debug_as_f(
|
||||
f,
|
||||
"[FUNC END] {%s-%d} %f",
|
||||
(func_name, id, end-start,),
|
||||
(func_name, id, end - start,),
|
||||
)
|
||||
|
||||
return r
|
||||
|
|
|
@ -163,7 +163,7 @@ class _PerHostRatelimiter(object):
|
|||
"Ratelimit [%s]: sleeping req",
|
||||
id(request_id),
|
||||
)
|
||||
ret_defer = sleep(self.sleep_msec/1000.0)
|
||||
ret_defer = sleep(self.sleep_msec / 1000.0)
|
||||
|
||||
self.sleeping_requests.add(request_id)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue