semaphoreui-client 0.1.10__py3-none-any.whl → 0.1.12__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.
@@ -1 +1 @@
1
- __version__ = "0.1.10"
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
- return [Template(**data, client=self) for data in response.json()]
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(self, project_id: int, id: int) -> "TaskOutput":
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: semaphoreui-client
3
- Version: 0.1.10
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,6 @@
1
+ semaphoreui_client/__about__.py,sha256=LcIlFjHZFfiF9Rd4UHoakmombOFkxIYk00I181frGBM,23
2
+ semaphoreui_client/__init__.py,sha256=VpeJavEFhs5gyfih7CoRTR4K4IGXGY3UYUkgAWj_f2U,56
3
+ semaphoreui_client/client.py,sha256=C9RtN0ZAlo211VPbyHogLKabdZR-XfO5Rg0tXW-HtIY,30748
4
+ semaphoreui_client-0.1.12.dist-info/METADATA,sha256=i8lLpbaI1dQBwKaZ9dB__SECuoC1MKo9uvWTkd8seeE,1633
5
+ semaphoreui_client-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ semaphoreui_client-0.1.12.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- semaphoreui_client/__about__.py,sha256=z0zCHFTcKSR0tJ6h5qrpNmRVP21QIPP8N0p7quCnnm0,23
2
- semaphoreui_client/__init__.py,sha256=VpeJavEFhs5gyfih7CoRTR4K4IGXGY3UYUkgAWj_f2U,56
3
- semaphoreui_client/client.py,sha256=uBpj-jfXZlps4wAVJvN6nY0NckND9UWbDSBbIqM8kb8,30351
4
- semaphoreui_client-0.1.10.dist-info/METADATA,sha256=WVto7jlm8L-1EUil7_npvi5ODflTMbREvbsxayT-wYo,1633
5
- semaphoreui_client-0.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- semaphoreui_client-0.1.10.dist-info/RECORD,,