mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
Update ruff config (+ fix violations)
This commit is contained in:
parent
a929733105
commit
72f3a96560
@ -79,11 +79,11 @@ class Uploader:
|
||||
change_by_obj = {}
|
||||
for obj, change in records.items():
|
||||
by_model[type(obj)].add(obj.id)
|
||||
change_by_obj[type(obj), obj.id] = change
|
||||
change_by_obj[(type(obj), obj.id)] = change
|
||||
rv = {}
|
||||
for model, ids in by_model.items():
|
||||
for obj in self.backend.get_data_query(model, ids).yield_per(5000):
|
||||
rv[obj] = change_by_obj[model, obj.id]
|
||||
rv[obj] = change_by_obj[(model, obj.id)]
|
||||
assert len(records) == len(rv)
|
||||
return rv
|
||||
|
||||
|
||||
@ -44,11 +44,11 @@ def stringify_seconds(seconds=0):
|
||||
"""
|
||||
seconds = int(seconds)
|
||||
minutes = seconds / 60
|
||||
ti = {'h': 0, 'm': 0, 's': 0}
|
||||
|
||||
h = m = s = 0
|
||||
if seconds > 0:
|
||||
ti['s'] = seconds % 60
|
||||
ti['m'] = minutes % 60
|
||||
ti['h'] = minutes / 60
|
||||
s = seconds % 60
|
||||
m = minutes % 60
|
||||
h = minutes / 60
|
||||
|
||||
return '%dh %dm %ds' % (ti['h'], ti['m'], ti['s'])
|
||||
return f'{h}h {m}m {s}s'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user