Skip to content

Commit 588adf2

Browse files
committed
dur
Signed-off-by: Ayush Kamat <[email protected]>
1 parent 451e7d6 commit 588adf2

File tree

6 files changed

+30
-22
lines changed

6 files changed

+30
-22
lines changed

latch_cli/menus.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import os
22
import sys
3-
import termios
4-
import tty
53
from typing import Any, Callable, Generic, List, Optional, Tuple, TypeVar
64

75
from typing_extensions import TypedDict
@@ -261,6 +259,9 @@ def render(
261259

262260
return num_lines_rendered
263261

262+
import termios
263+
import tty
264+
264265
old_settings = termios.tcgetattr(sys.stdin.fileno())
265266
tty.setraw(sys.stdin.fileno())
266267

latch_cli/services/execute/main.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import os
55
import signal
66
import sys
7-
import termios
8-
import tty
97
from typing import Generic, Literal, Optional, Tuple, TypedDict, TypeVar, Union
108
from urllib.parse import urljoin, urlparse
119

@@ -186,6 +184,9 @@ def exec(
186184
egn_info = get_egn_info(execution_info, egn_id)
187185
container_info = get_container_info(egn_info, container_index)
188186

187+
import termios
188+
import tty
189+
189190
old_settings_stdin = termios.tcgetattr(sys.stdin.fileno())
190191
tty.setraw(sys.stdin)
191192

latch_cli/services/get_executions.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import os
22
import sys
3-
import termios
43
import textwrap
5-
import tty
64
from pathlib import Path
75
from typing import Dict, List
86

@@ -50,12 +48,10 @@ def get_executions():
5048
]
5149

5250
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+
})
5955

6056
_all_executions(
6157
title="All Executions",
@@ -142,6 +138,9 @@ def render(
142138
menus._show()
143139
return max_row_len
144140

141+
import termios
142+
import tty
143+
145144
old_settings = termios.tcgetattr(sys.stdin.fileno())
146145
tty.setraw(sys.stdin.fileno())
147146

@@ -223,7 +222,8 @@ def render(
223222
prev = (curr_selected, hor_index, term_width, term_height)
224223
menus.clear_screen()
225224
max_row_len = render(curr_selected, hor_index, term_width, term_height)
226-
except KeyboardInterrupt: ...
225+
except KeyboardInterrupt:
226+
...
227227
finally:
228228
menus.clear_screen()
229229
menus.reveal_cursor()
@@ -316,7 +316,8 @@ def render(curr_selected: int, term_width: int, term_height: int):
316316
menus.clear_screen()
317317
prev = (curr_selected, term_width, term_height)
318318
render(curr_selected, term_width, term_height)
319-
except KeyboardInterrupt: ...
319+
except KeyboardInterrupt:
320+
...
320321
finally:
321322
menus.clear_screen()
322323
menus.move_cursor((0, 0))
@@ -452,7 +453,8 @@ def render(vert_index, hor_index, term_width, term_height):
452453
menus.clear_screen()
453454
prev_term_dims = (vert_index, hor_index, term_width, term_height)
454455
render(vert_index, hor_index, term_width, term_height)
455-
except KeyboardInterrupt: ...
456+
except KeyboardInterrupt:
457+
...
456458
finally:
457459
log_sched.shutdown()
458460
log_file.unlink(missing_ok=True)
@@ -513,7 +515,8 @@ def render(term_width: int, term_height: int):
513515
if prev_term_dims != (term_width, term_height):
514516
prev_term_dims = (term_width, term_height)
515517
render(term_width, term_height)
516-
except KeyboardInterrupt: ...
518+
except KeyboardInterrupt:
519+
...
517520
finally:
518521
menus.clear_screen()
519522
menus.move_cursor((0, 0))

latch_cli/services/local_dev_old.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
import signal
55
import subprocess
66
import sys
7-
import termios
87
import time
98
import traceback
10-
import tty
119
from enum import Enum
1210
from http.client import HTTPException
1311
from pathlib import Path
@@ -256,6 +254,9 @@ async def _send_resize_message(
256254
async def _shell_session(
257255
ws: client.WebSocketClientProtocol,
258256
):
257+
import termios
258+
import tty
259+
259260
old_settings_stdin = termios.tcgetattr(sys.stdin.fileno())
260261
tty.setraw(sys.stdin)
261262

latch_cli/services/preview.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import os
22
import sys
3-
import termios
4-
import tty
53
import webbrowser
64
from pathlib import Path
75
from typing import List
@@ -125,6 +123,9 @@ def render(
125123

126124
return num_lines_rendered
127125

126+
import termios
127+
import tty
128+
128129
old_settings = termios.tcgetattr(sys.stdin.fileno())
129130
tty.setraw(sys.stdin.fileno())
130131

@@ -176,7 +177,8 @@ def render(
176177
start_index=start_index,
177178
max_per_page=max_per_page,
178179
)
179-
except KeyboardInterrupt: ...
180+
except KeyboardInterrupt:
181+
...
180182
finally:
181183
menus.clear(num_lines_rendered)
182184
menus.reveal_cursor()

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setup(
1515
name="latch",
16-
version="v2.52.0",
16+
version="v2.52.1",
1717
author_email="[email protected]",
1818
description="The Latch SDK",
1919
packages=find_packages(),

0 commit comments

Comments
 (0)