@@ -40,7 +40,7 @@ def get_supported_hash_types(ctx: typer.Context) -> None:
40
40
smpclient = get_smpclient (options )
41
41
42
42
async def f () -> None :
43
- await connect_with_spinner (smpclient )
43
+ await connect_with_spinner (smpclient , options . timeout )
44
44
45
45
r = await smp_request (smpclient , options , SupportedFileHashChecksumTypes (), "Waiting for supported hash types..." ) # type: ignore # noqa
46
46
@@ -64,7 +64,7 @@ def get_hash(
64
64
smpclient = get_smpclient (options )
65
65
66
66
async def f () -> None :
67
- await connect_with_spinner (smpclient )
67
+ await connect_with_spinner (smpclient , options . timeout )
68
68
69
69
r = await smp_request (smpclient , options , FileHashChecksum (name = file ), "Waiting for hash..." ) # type: ignore # noqa
70
70
@@ -86,7 +86,7 @@ def read_size(
86
86
smpclient = get_smpclient (options )
87
87
88
88
async def f () -> None :
89
- await connect_with_spinner (smpclient )
89
+ await connect_with_spinner (smpclient , options . timeout )
90
90
91
91
r = await smp_request (smpclient , options , FileStatus (name = file ), "Waiting for file size..." ) # type: ignore # noqa
92
92
@@ -141,10 +141,11 @@ def upload(
141
141
) -> None :
142
142
"""Upload a file."""
143
143
144
- smpclient = get_smpclient (cast (Options , ctx .obj ))
144
+ options = cast (Options , ctx .obj )
145
+ smpclient = get_smpclient (options )
145
146
146
147
async def f () -> None :
147
- await connect_with_spinner (smpclient )
148
+ await connect_with_spinner (smpclient , options . timeout )
148
149
with open (file , "rb" ) as f :
149
150
await upload_with_progress_bar (smpclient , f , destination )
150
151
@@ -159,10 +160,11 @@ def download(
159
160
) -> None :
160
161
"""Download a file."""
161
162
162
- smpclient = get_smpclient (cast (Options , ctx .obj ))
163
+ options = cast (Options , ctx .obj )
164
+ smpclient = get_smpclient (options )
163
165
164
166
async def f () -> None :
165
- await connect_with_spinner (smpclient )
167
+ await connect_with_spinner (smpclient , options . timeout )
166
168
with destination .open ("wb" ) as dest_f :
167
169
file_data = await smpclient .download_file (file )
168
170
dest_f .write (file_data )
0 commit comments