|
1 | 1 | import os
|
2 | 2 | import sys
|
3 |
| -import termios |
4 | 3 | import textwrap
|
5 |
| -import tty |
6 | 4 | from pathlib import Path
|
7 | 5 | from typing import Dict, List
|
8 | 6 |
|
@@ -50,12 +48,10 @@ def get_executions():
|
50 | 48 | ]
|
51 | 49 |
|
52 | 50 | for execution_data in sorted(data.values(), key=lambda x: -int(x["id"])):
|
53 |
| - options.append( |
54 |
| - { |
55 |
| - **execution_data, |
56 |
| - "workflow_tagged": f'{execution_data["workflow_name"]}/{execution_data["workflow_version"]}', |
57 |
| - } |
58 |
| - ) |
| 51 | + options.append({ |
| 52 | + **execution_data, |
| 53 | + "workflow_tagged": f'{execution_data["workflow_name"]}/{execution_data["workflow_version"]}', |
| 54 | + }) |
59 | 55 |
|
60 | 56 | _all_executions(
|
61 | 57 | title="All Executions",
|
@@ -142,6 +138,9 @@ def render(
|
142 | 138 | menus._show()
|
143 | 139 | return max_row_len
|
144 | 140 |
|
| 141 | + import termios |
| 142 | + import tty |
| 143 | + |
145 | 144 | old_settings = termios.tcgetattr(sys.stdin.fileno())
|
146 | 145 | tty.setraw(sys.stdin.fileno())
|
147 | 146 |
|
@@ -223,7 +222,8 @@ def render(
|
223 | 222 | prev = (curr_selected, hor_index, term_width, term_height)
|
224 | 223 | menus.clear_screen()
|
225 | 224 | max_row_len = render(curr_selected, hor_index, term_width, term_height)
|
226 |
| - except KeyboardInterrupt: ... |
| 225 | + except KeyboardInterrupt: |
| 226 | + ... |
227 | 227 | finally:
|
228 | 228 | menus.clear_screen()
|
229 | 229 | menus.reveal_cursor()
|
@@ -316,7 +316,8 @@ def render(curr_selected: int, term_width: int, term_height: int):
|
316 | 316 | menus.clear_screen()
|
317 | 317 | prev = (curr_selected, term_width, term_height)
|
318 | 318 | render(curr_selected, term_width, term_height)
|
319 |
| - except KeyboardInterrupt: ... |
| 319 | + except KeyboardInterrupt: |
| 320 | + ... |
320 | 321 | finally:
|
321 | 322 | menus.clear_screen()
|
322 | 323 | menus.move_cursor((0, 0))
|
@@ -452,7 +453,8 @@ def render(vert_index, hor_index, term_width, term_height):
|
452 | 453 | menus.clear_screen()
|
453 | 454 | prev_term_dims = (vert_index, hor_index, term_width, term_height)
|
454 | 455 | render(vert_index, hor_index, term_width, term_height)
|
455 |
| - except KeyboardInterrupt: ... |
| 456 | + except KeyboardInterrupt: |
| 457 | + ... |
456 | 458 | finally:
|
457 | 459 | log_sched.shutdown()
|
458 | 460 | log_file.unlink(missing_ok=True)
|
@@ -513,7 +515,8 @@ def render(term_width: int, term_height: int):
|
513 | 515 | if prev_term_dims != (term_width, term_height):
|
514 | 516 | prev_term_dims = (term_width, term_height)
|
515 | 517 | render(term_width, term_height)
|
516 |
| - except KeyboardInterrupt: ... |
| 518 | + except KeyboardInterrupt: |
| 519 | + ... |
517 | 520 | finally:
|
518 | 521 | menus.clear_screen()
|
519 | 522 | menus.move_cursor((0, 0))
|
0 commit comments