kleinkram 0.34.2.dev20241029082458__py3-none-any.whl → 0.34.3.dev20241029194617__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kleinkram might be problematic. Click here for more details.

@@ -258,7 +258,7 @@ def upload(
258
258
  List[str],
259
259
  typer.Option(prompt=True, help="Path to files to upload, Regex supported"),
260
260
  ],
261
- mission: Annotated[
261
+ mission_uuid: Annotated[
262
262
  str, typer.Option(prompt=True, help="UUID of Mission to create")
263
263
  ],
264
264
  ):
@@ -269,7 +269,7 @@ def upload(
269
269
  Multiple paths can be given by using the option multiple times.\n
270
270
  \n
271
271
  Examples:\n
272
- - 'klein upload --path "~/data/**/*.bag" --project "Project_1" --mission "2518cfc2-07f2-41a5-b74c-fdedb1b97f88" '\n
272
+ - 'klein upload --path "~/data/**/*.bag" --mission-uuid "2518cfc2-07f2-41a5-b74c-fdedb1b97f88" '\n
273
273
 
274
274
  """
275
275
  files = []
@@ -281,7 +281,7 @@ def upload(
281
281
  if not filenames:
282
282
  raise ValueError("No files found matching the given path.")
283
283
 
284
- print(f"Uploading the following files to mission '{mission}':")
284
+ print(f"Uploading the following files to mission '{mission_uuid}':")
285
285
  filepaths = {}
286
286
  for path in files:
287
287
  if not os.path.isdir(path):
@@ -290,29 +290,20 @@ def upload(
290
290
 
291
291
  try:
292
292
  client = AuthenticatedClient()
293
- res = client.post(
294
- "/file/temporaryAccess",
295
- json={"missionUUID": mission, "filenames": filenames},
293
+ get_temporary_credentials = "/file/temporaryAccess"
294
+ response = client.post(
295
+ get_temporary_credentials,
296
+ json={"filenames": filenames, "missionUUID": mission_uuid},
296
297
  )
297
- if res.status_code >= 400:
298
+ if response.status_code >= 400:
298
299
  raise ValueError(
299
- "Failed to get temporary access. Status code: "
300
- + str(res.status_code)
301
- + " Message: "
302
- + res.json()["message"]
300
+ "Failed to upload data. Status Code: "
301
+ + str(response.status_code)
302
+ + "\n"
303
+ + response.json()["message"][0]
303
304
  )
304
305
 
305
- temp_credentials = res.json()
306
- credential = temp_credentials["credentials"]
307
- confirmed_files = temp_credentials["files"]
308
- for _file in filenames:
309
- if not _file in confirmed_files.keys():
310
- raise Exception(
311
- "Could not upload File '" + _file + "'. Is the filename unique? "
312
- )
313
- confirmed_files[_file]["filepath"] = filepaths[_file]
314
- if len(confirmed_files.keys()) > 0:
315
- uploadFiles(confirmed_files, credential, 4)
306
+ uploadFiles(response.json(), filepaths, 4)
316
307
  except Exception as e:
317
308
  print(e)
318
309
  print("Failed to upload files")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kleinkram
3
- Version: 0.34.2.dev20241029082458
3
+ Version: 0.34.3.dev20241029194617
4
4
  Summary: A CLI for the ETH project kleinkram
5
5
  Project-URL: Homepage, https://github.com/leggedrobotics/kleinkram
6
6
  Project-URL: Issues, https://github.com/leggedrobotics/kleinkram/issues
@@ -7,14 +7,14 @@ kleinkram/main.py,sha256=D1zwoBjEemm8-13bpR_E7GtB-JrGfE7ljH5w0BVbirs,17354
7
7
  kleinkram/auth/auth.py,sha256=w3-TsxWxURzLQ3_p43zgV4Rlh4dVL_WqI6HG2aes-b4,4991
8
8
  kleinkram/endpoint/endpoint.py,sha256=WmHUH10_OSZUMrovh2yBeth9dBcn0yE7PxnnD4yPW-Y,1582
9
9
  kleinkram/file/file.py,sha256=1IRXTxGGH5tIvvmMoee5jvmN4QGyIJSJ2xtHraHGFHE,5390
10
- kleinkram/mission/mission.py,sha256=1nBF8TX76JqY-Gi50cRWe7WZhAYsrHP5gXtLOLH_XLs,10203
10
+ kleinkram/mission/mission.py,sha256=2S8Xopb45fr2y21FrUlABGXtklo9BvY3B-yUFCzLIJI,9790
11
11
  kleinkram/project/project.py,sha256=4BOT3iOZZnMrZuALzBxQ5r-8dC8eZkel1OjxUFzK0w4,4336
12
12
  kleinkram/queue/queue.py,sha256=MaLBjAu8asi9BkPvbbT-5AobCcpy3ex5rxM1kHpRINA,181
13
13
  kleinkram/tag/tag.py,sha256=JSHbDPVfsvP34MuQhw__DPQk-Bah5G9BgwYsj_K_JGc,1805
14
14
  kleinkram/topic/topic.py,sha256=IaXhrIHcJ3FSIr0WC-N7u9fkz-lAvSBgQklTX67t0Yc,1641
15
15
  kleinkram/user/user.py,sha256=SzUM-CTTmC3TYCNt4Crizc7n3Rpf2ObJeNWEeEmMfpo,1893
16
- kleinkram-0.34.2.dev20241029082458.dist-info/METADATA,sha256=PffO8Bsi3_8Q4VfsgE8N7lvONUcWKcFR2Nj95ALWNNo,845
17
- kleinkram-0.34.2.dev20241029082458.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
18
- kleinkram-0.34.2.dev20241029082458.dist-info/entry_points.txt,sha256=RHXtRzcreVHImatgjhQwZQ6GdJThElYjHEWcR1BPXUI,45
19
- kleinkram-0.34.2.dev20241029082458.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
20
- kleinkram-0.34.2.dev20241029082458.dist-info/RECORD,,
16
+ kleinkram-0.34.3.dev20241029194617.dist-info/METADATA,sha256=Soz80p0ITbxeNd0b4ehD_M-eOXyOJl1vdmlav3L4z18,845
17
+ kleinkram-0.34.3.dev20241029194617.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
18
+ kleinkram-0.34.3.dev20241029194617.dist-info/entry_points.txt,sha256=RHXtRzcreVHImatgjhQwZQ6GdJThElYjHEWcR1BPXUI,45
19
+ kleinkram-0.34.3.dev20241029194617.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
20
+ kleinkram-0.34.3.dev20241029194617.dist-info/RECORD,,