kleinkram 0.30.2.dev20241010132702__tar.gz → 0.30.4.dev20241010181849__tar.gz

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.

Files changed (24) hide show
  1. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/PKG-INFO +1 -1
  2. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/pyproject.toml +1 -1
  3. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/mission/mission.py +30 -24
  4. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/.gitignore +0 -0
  5. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/LICENSE +0 -0
  6. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/README.md +0 -0
  7. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/deploy.sh +0 -0
  8. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/dev.sh +0 -0
  9. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/requirements.txt +0 -0
  10. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/klein.py +0 -0
  11. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/__init__.py +0 -0
  12. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/api_client.py +0 -0
  13. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/auth/auth.py +0 -0
  14. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/consts.py +0 -0
  15. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/endpoint/endpoint.py +0 -0
  16. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/error_handling.py +0 -0
  17. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/file/file.py +0 -0
  18. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/helper.py +0 -0
  19. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/main.py +0 -0
  20. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/project/project.py +0 -0
  21. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/queue/queue.py +0 -0
  22. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/tag/tag.py +0 -0
  23. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/topic/topic.py +0 -0
  24. {kleinkram-0.30.2.dev20241010132702 → kleinkram-0.30.4.dev20241010181849}/src/kleinkram/user/user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kleinkram
3
- Version: 0.30.2.dev20241010132702
3
+ Version: 0.30.4.dev20241010181849
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "kleinkram"
7
- version = "0.30.2-dev20241010132702"
7
+ version = "0.30.4-dev20241010181849"
8
8
  description = "A CLI for the ETH project kleinkram"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -156,8 +156,8 @@ def mission_by_uuid(
156
156
 
157
157
  @missionCommands.command("download")
158
158
  def download(
159
- mission_uuid: Annotated[str, typer.Argument()],
160
- local_path: Annotated[str, typer.Argument()],
159
+ mission_uuid: Annotated[List[str], typer.Option(help="UUIDs of Mission to download")],
160
+ local_path: Annotated[str, typer.Option()],
161
161
  ):
162
162
  """
163
163
 
@@ -172,34 +172,40 @@ def download(
172
172
  raise ValueError(f"Local path '{local_path}' is not empty, but must be empty.")
173
173
 
174
174
  client = AuthenticatedClient()
175
- response = client.get("/mission/download", params={"uuid": mission_uuid})
175
+ for single_mission_uuid in mission_uuid:
176
+ response = client.get("/mission/download", params={"uuid": single_mission_uuid})
177
+ try:
178
+ response.raise_for_status()
179
+ except httpx.HTTPError as e:
180
+ raise AccessDeniedException(
181
+ f"Failed to download file."
182
+ f"Consider using the following command to list all missions: 'klein mission list --verbose'\n",
183
+ f"{response.json()['message']} ({response.status_code})",
184
+ )
176
185
 
177
- try:
178
- response.raise_for_status()
179
- except httpx.HTTPError as e:
180
- raise AccessDeniedException(
181
- f"Failed to download file."
182
- f"Consider using the following command to list all missions: 'klein mission list --verbose'\n",
183
- f"{response.json()['message']} ({response.status_code})",
184
- )
186
+ paths = response.json()
187
+ if(len(paths) == 0):
188
+ continue
189
+ mission_name = paths[0].split("/")[5] # Trust me bro
185
190
 
186
- paths = response.json()
191
+ local_mission_path = os.path.join(local_path, mission_name)
192
+ os.mkdir(local_mission_path)
187
193
 
188
- print(f"Downloading files to {local_path}:")
189
- for path in paths:
194
+ print(f"Downloading files to {local_mission_path}:")
195
+ for path in paths:
190
196
 
191
- filename = path.split("/")[-1].split("?")[0]
192
- print(f" - {filename}")
197
+ filename = path.split("/")[-1].split("?")[0]
198
+ print(f" - {filename}")
193
199
 
194
- response = requests.get(path, stream=True) # Enable streaming mode
195
- chunk_size = 1024 * 100 # 100 KB chunks, adjust size if needed
200
+ response = requests.get(path, stream=True) # Enable streaming mode
201
+ chunk_size = 1024 * 100 # 100 KB chunks, adjust size if needed
196
202
 
197
- # Open the file for writing in binary mode
198
- with open(os.path.join(local_path, filename), "wb") as f:
199
- for chunk in response.iter_content(chunk_size=chunk_size):
200
- if chunk: # Filter out keep-alive new chunks
201
- f.write(chunk)
202
- print(f" Downloaded {filename}")
203
+ # Open the file for writing in binary mode
204
+ with open(os.path.join(local_mission_path, filename), "wb") as f:
205
+ for chunk in response.iter_content(chunk_size=chunk_size):
206
+ if chunk: # Filter out keep-alive new chunks
207
+ f.write(chunk)
208
+ print(f" Downloaded {filename}")
203
209
 
204
210
 
205
211
  @missionCommands.command("upload")