Skip to content

Commit d335c3d

Browse files
author
Caspar van Leeuwen
committed
Fix too long lines
1 parent 296942f commit d335c3d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

eessi_bot_event_handler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,15 +604,18 @@ def handle_bot_command_status(self, event_info, bot_command):
604604
status_table['timestamp'] = timestamps
605605

606606
# Figure out the sorting indices, so that things are sorted first by the 'for arch', and then by 'date'
607-
sorted_indices = sorted(range(len(status_table['for arch'])), key=lambda x: (status_table['for arch'][x], status_table['timestamp'][x]))
607+
key_func = lambda x: (status_table['for arch'][x], status_table['timestamp'][x])
608+
sorted_indices = sorted(range(len(status_table['for arch'])), key=key_func)
608609
# Reverse, so that the newest builds are first
609610
sorted_indices.reverse()
610611
# Apply the sorted indices to get a sorted table
611612
sorted_table = {key: [status_table[key][i] for i in sorted_indices] for key in status_table}
612613
self.log(f"Sorted status table: {sorted_table}")
613614

614615
# Keep only the first entry for each 'for arch', as that is now the newest
615-
status_table_last = {'on arch': [], 'for arch': [], 'for repo': [], 'date': [], 'status': [], 'url': [], 'result': []}
616+
status_table_last = {
617+
'on arch': [], 'for arch': [], 'for repo': [], 'date': [], 'status': [], 'url': [], 'result': []
618+
}
616619
for x in range(0, len(sorted_table['date'])):
617620
if sorted_table['for arch'][x] not in status_table_last['for arch']:
618621
self.log(f"arch: {sorted_table['for arch'][x]} not yet in status_table_last")
@@ -621,7 +624,8 @@ def handle_bot_command_status(self, event_info, bot_command):
621624
status_table_last[key].append(sorted_table[key][x])
622625

623626
# Re-sort, now only on 'for arch', for nicer viewing
624-
sorted_indices = sorted(range(len(status_table_last['for arch'])), key=lambda x: status_table_last['for arch'][x])
627+
key_func = lambda x: status_table_last['for arch'][x]
628+
sorted_indices = sorted(range(len(status_table_last['for arch'])), key=key_func)
625629
sorted_table_last = {key: [status_table_last[key][i] for i in sorted_indices] for key in status_table_last}
626630

627631
# overwrite the original status_table

0 commit comments

Comments
 (0)