semaphoreui-client 0.1.10__tar.gz → 0.1.12__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.
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/PKG-INFO +1 -1
- semaphoreui_client-0.1.12/semaphoreui_client/__about__.py +1 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/semaphoreui_client/client.py +15 -4
- semaphoreui_client-0.1.10/semaphoreui_client/__about__.py +0 -1
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/.github/workflows/checks.yml +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/.github/workflows/pre-release.yml +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/.github/workflows/release.yml +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/.gitignore +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/README.md +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/pyproject.toml +0 -0
- {semaphoreui_client-0.1.10 → semaphoreui_client-0.1.12}/semaphoreui_client/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: semaphoreui-client
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.12
|
4
4
|
Summary: An api client for interacting with Semaphore UI
|
5
5
|
Project-URL: Documentation, https://github.com/rockstar/semaphoreui-client#readme
|
6
6
|
Project-URL: Issues, https://github.com/rockstar/semaphoreui-client/issues
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.1.12"
|
@@ -390,7 +390,12 @@ class SemaphoreUIClient:
|
|
390
390
|
def get_project_templates(self, project_id: int) -> typing.List["Template"]:
|
391
391
|
response = self.http.get(f"{self.api_endpoint}/project/{project_id}/templates")
|
392
392
|
assert response.status_code == 200
|
393
|
-
|
393
|
+
templates: typing.List["Template"] = []
|
394
|
+
for template in response.json():
|
395
|
+
if template["last_task"] is not None:
|
396
|
+
template["last_task"] = Task(**template["last_task"], client=self)
|
397
|
+
template.append(templates)
|
398
|
+
return templates
|
394
399
|
|
395
400
|
def create_project_template(
|
396
401
|
self,
|
@@ -529,12 +534,14 @@ class SemaphoreUIClient:
|
|
529
534
|
)
|
530
535
|
assert response.status_code == 204
|
531
536
|
|
532
|
-
def get_project_task_output(
|
537
|
+
def get_project_task_output(
|
538
|
+
self, project_id: int, id: int
|
539
|
+
) -> typing.List["TaskOutput"]:
|
533
540
|
response = self.http.get(
|
534
541
|
f"{self.api_endpoint}/project/{project_id}/tasks/{id}/output"
|
535
542
|
)
|
536
543
|
assert response.status_code == 200
|
537
|
-
return TaskOutput(**response.json()
|
544
|
+
return [TaskOutput(**data) for data in response.json()]
|
538
545
|
|
539
546
|
|
540
547
|
@dataclass
|
@@ -975,12 +982,16 @@ class Task:
|
|
975
982
|
def delete(self) -> None:
|
976
983
|
self.client.delete_project_task(self.project_id, self.id)
|
977
984
|
|
978
|
-
def output(self) -> "TaskOutput":
|
985
|
+
def output(self) -> typing.List["TaskOutput"]:
|
979
986
|
return self.client.get_project_task_output(self.project_id, self.id)
|
980
987
|
|
988
|
+
def normalized_output(self) -> typing.List[str]:
|
989
|
+
return [output.output for output in self.output()]
|
990
|
+
|
981
991
|
|
982
992
|
@dataclass
|
983
993
|
class TaskOutput:
|
984
994
|
task_id: int
|
995
|
+
task: str
|
985
996
|
time: str
|
986
997
|
output: str
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.1.10"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|