gnetclisdk 1.0.38__py3-none-any.whl → 1.0.40__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
gnetclisdk/client.py CHANGED
@@ -235,7 +235,8 @@ class Gnetcli:
235
235
  host=hostname,
236
236
  port=params.port,
237
237
  credentials=params.credentials.make_pb(),
238
- device=params.device)
238
+ device=params.device,
239
+ )
239
240
  _logger.debug("connect to %s", self._server)
240
241
  async with self._grpc_channel_fn(self._server, options=self._options) as channel:
241
242
  _logger.debug("set params for %s", hostname)
@@ -243,8 +244,11 @@ class Gnetcli:
243
244
  await grpc_call_wrapper(stub.SetupHostParams, pbcmd)
244
245
  return
245
246
 
246
- async def upload(self, hostname: str, files: Dict[str, File]) -> None:
247
- pbcmd = server_pb2.FileUploadRequest(host=hostname, files=make_files_request(files))
247
+ async def upload(self, hostname: str, files: Dict[str, File], host_params: Optional[HostParams] = None) -> None:
248
+ host_params_pb: Optional[server_pb2.HostParams] = None
249
+ if host_params:
250
+ host_params_pb = host_params.make_pb()
251
+ pbcmd = server_pb2.FileUploadRequest(host=hostname, files=make_files_request(files), host_params=host_params_pb)
248
252
  _logger.debug("connect to %s", self._server)
249
253
  async with self._grpc_channel_fn(self._server, options=self._options) as channel:
250
254
  _logger.debug("upload %s to %s", files.keys(), hostname)
@@ -253,8 +257,11 @@ class Gnetcli:
253
257
  _logger.debug("upload res %s", response)
254
258
  return
255
259
 
256
- async def download(self, hostname: str, paths: List[str]) -> Dict[str, File]:
257
- pbcmd = server_pb2.FileDownloadRequest(host=hostname, paths=paths)
260
+ async def download(self, hostname: str, paths: List[str], host_params: Optional[HostParams] = None) -> Dict[str, File]:
261
+ host_params_pb: Optional[server_pb2.HostParams] = None
262
+ if host_params:
263
+ host_params_pb = host_params.make_pb()
264
+ pbcmd = server_pb2.FileDownloadRequest(host=hostname, paths=paths, host_params=host_params_pb)
258
265
  _logger.debug("connect to %s", self._server)
259
266
  async with self._grpc_channel_fn(self._server, options=self._options) as channel:
260
267
  _logger.debug("download %s from %s", paths, hostname)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gnetclisdk
3
- Version: 1.0.38
3
+ Version: 1.0.40
4
4
  Summary: Client for Gnetcli GRPC-server
5
5
  Home-page: https://github.com/annetutil/gnetcli
6
6
  Author: Alexander Balezin
@@ -1,11 +1,11 @@
1
1
  gnetclisdk/auth.py,sha256=GwM7H7Ecb-gwqUTkQorifNB_mtnZfgeS46gOW2Vx1U4,1246
2
- gnetclisdk/client.py,sha256=xtDbGJ3voTadmR7lt8WC-LKcBzk1v_otnaqG3LzKZjE,17899
2
+ gnetclisdk/client.py,sha256=bT5lG7g3excrz39ZexCSNg4CBKGSlgMUGLrDC3hnUgM,18325
3
3
  gnetclisdk/exceptions.py,sha256=d0Bcq8tnAzemCuCCrGJEmL_A1IQxCCLFRCwDhr9zvkU,2683
4
4
  gnetclisdk/interceptors.py,sha256=apj3l4lnR2ZcsA49odptrBC0kTDmP6Mp0EzYkeEJz9Y,7010
5
5
  gnetclisdk/proto/server_pb2.py,sha256=YL1_7wubJbSp97OeRZ_L9qJjbM2U-PMcfOg-_QpkjWs,8360
6
6
  gnetclisdk/proto/server_pb2.pyi,sha256=th-HnFVkR1ZEY-XmFmk8VMfDj_4uFAoSAXH61mSlVec,8295
7
7
  gnetclisdk/proto/server_pb2_grpc.py,sha256=rjuNEIfeqwFw99oSiWUyvNKCKPgITJZKcL8pQPbUQvM,14967
8
- gnetclisdk-1.0.38.dist-info/METADATA,sha256=EfePd-zshHm7t2NuuCodi5rcFbScomHncuHf3kYXcAA,1434
9
- gnetclisdk-1.0.38.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10
- gnetclisdk-1.0.38.dist-info/top_level.txt,sha256=MNjS8LEt6d2rZ-dUbV2cnqkuTMu3EqEL2eiSvUZuUlA,11
11
- gnetclisdk-1.0.38.dist-info/RECORD,,
8
+ gnetclisdk-1.0.40.dist-info/METADATA,sha256=iYMRdOmStuN5rPXlZz-st6JwMCEHOy4mJL2T6wg7dw0,1434
9
+ gnetclisdk-1.0.40.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10
+ gnetclisdk-1.0.40.dist-info/top_level.txt,sha256=MNjS8LEt6d2rZ-dUbV2cnqkuTMu3EqEL2eiSvUZuUlA,11
11
+ gnetclisdk-1.0.40.dist-info/RECORD,,