gazu 0.10.26__py2.py3-none-any.whl → 0.10.28__py2.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.
gazu/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.10.26"
1
+ __version__ = "0.10.28"
gazu/person.py CHANGED
@@ -117,8 +117,8 @@ def get_person(id, relations=False, client=default):
117
117
  dict: Person corresponding to given id.
118
118
  """
119
119
  params = {"id": id}
120
- if not relations:
121
- params["relations"] = False
120
+ if relations:
121
+ params["relations"] = True
122
122
 
123
123
  return raw.fetch_first("persons", params=params, client=client)
124
124
 
gazu/project.py CHANGED
@@ -76,7 +76,7 @@ def get_project_url(project, section="assets", client=default):
76
76
  project = normalize_model_parameter(project)
77
77
  path = "{host}/productions/{project_id}/{section}/"
78
78
  return path.format(
79
- host=raw.get_api_url_from_host(),
79
+ host=raw.get_api_url_from_host(client=client),
80
80
  project_id=project["id"],
81
81
  section=section,
82
82
  )
gazu/task.py CHANGED
@@ -471,6 +471,27 @@ def get_task_type_by_name(
471
471
  return raw.fetch_first("task-types", params, client=client)
472
472
 
473
473
 
474
+ @cache
475
+ def get_task_type_by_short_name(
476
+ task_type_short_name, for_entity=None, department=None, client=default
477
+ ):
478
+ """
479
+ Args:
480
+ task_type_short_name (str): Short name of claimed task type.
481
+ for_entity (str): The entity type for which the task type is created.
482
+ department (str): The department for which the task type is created.
483
+
484
+ Returns:
485
+ dict: Task type object for given name.
486
+ """
487
+ params = {"short_name": task_type_short_name}
488
+ if for_entity is not None:
489
+ params["for_entity"] = for_entity
490
+ if department is not None:
491
+ params["department_id"] = normalize_model_parameter(department)["id"]
492
+ return raw.fetch_first("task-types", params, client=client)
493
+
494
+
474
495
  @cache
475
496
  def get_task_by_path(project, file_path, entity_type="shot", client=default):
476
497
  """
@@ -740,7 +761,7 @@ def task_to_review(
740
761
  def get_time_spent(task, date=None, client=default):
741
762
  """
742
763
  Get the time spent by CG artists on a task at a given date if given. A field contains
743
- the total time spent. Durations are given in seconds. Date format is
764
+ the total time spent. Durations are given in minutes. Date format is
744
765
  YYYY-MM-DD.
745
766
 
746
767
  Args:
@@ -759,14 +780,13 @@ def get_time_spent(task, date=None, client=default):
759
780
 
760
781
  def set_time_spent(task, person, date, duration, client=default):
761
782
  """
762
- Set the time spent by a CG artist on a given task at a given date. Durations
763
- must be set in seconds. Date format is YYYY-MM-DD.
783
+ Set the time spent by a CG artist on a given task at a given date.
764
784
 
765
785
  Args:
766
786
  task (str / dict): The task dict or the task ID.
767
787
  person (str / dict): The person who spent the time on given task.
768
- date (str): The date for which time spent must be set.
769
- duration (int): The duration of the time spent on given task.
788
+ date (str): The date ("YYYY-MM-DD") for which time spent must be set.
789
+ duration (int): The duration (in minutes) of the time spent on given task.
770
790
 
771
791
  Returns:
772
792
  dict: Created time spent entry.
@@ -784,14 +804,13 @@ def set_time_spent(task, person, date, duration, client=default):
784
804
  def add_time_spent(task, person, date, duration, client=default):
785
805
  """
786
806
  Add given duration to the already logged duration for given task and person
787
- at a given date. Durations must be set in seconds. Date format is
788
- YYYY-MM-DD.
807
+ at a given date.
789
808
 
790
809
  Args:
791
810
  task (str / dict): The task dict or the task ID.
792
811
  person (str / dict): The person who spent the time on given task.
793
- date (str): The date for which time spent must be added.
794
- duration (int): The duration to add on the time spent on given task.
812
+ date (str): The date ("YYYY-MM-DD") for which time spent must be set.
813
+ duration (int): The duration (in minutes) of the time spent on given task.
795
814
 
796
815
  Returns:
797
816
  dict: Updated time spent entry.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gazu
3
- Version: 0.10.26
3
+ Version: 0.10.28
4
4
  Summary: Gazu is a client for Zou, the API to store the data of your CG production.
5
5
  Home-page: https://gazu.cg-wire.com/
6
6
  Author: CG Wire
@@ -1,5 +1,5 @@
1
1
  gazu/__init__.py,sha256=KPAVnFOSbzZnd24ItkZEOv7yQ5w0Pv7k1TFmL8saiqY,2594
2
- gazu/__version__.py,sha256=Q1S9n7i95kNFVbGNiNda3PobCvhN6qY3ElB_2GWgXHg,24
2
+ gazu/__version__.py,sha256=tSZZU-8sK-qpbXeRSFzt4sAk3MkGsXB2Vnh3aMuNrWo,24
3
3
  gazu/asset.py,sha256=ZAc8F-7GPQTU_nVcUpH_xSVf58k6TXudlP6XnFc_LJk,14686
4
4
  gazu/cache.py,sha256=MnxrnfYN7wHNTTL7qzkEpYCYzWcolT56fqQ0_RegMbE,5879
5
5
  gazu/casting.py,sha256=0LTdsHaCTHSKEflBWFeuraSaYNYetGkMHAIdg6Lv81U,5059
@@ -13,17 +13,17 @@ gazu/events.py,sha256=4j8wbF4K-f5Kyu_jI4bklS12huzAN0cjCdY4hcKyhuk,2221
13
13
  gazu/exception.py,sha256=Y0kVNm6h-uXLEU1sNIbMSUep7Zxk738uYHOIVs2waM8,1880
14
14
  gazu/files.py,sha256=3zx6GWRRI9RPc6cN7sUIsj4g-ARfeypUUVUIvxqqNj8,39744
15
15
  gazu/helpers.py,sha256=Qa4JlZitiXsfYMJGGuwVaedLvHQVMbIwcqEZ099EjMw,3916
16
- gazu/person.py,sha256=BFh54J_R6_pIgYxAF_yAxFzjsO98hTLeBAKiZxewiK0,11098
16
+ gazu/person.py,sha256=Ac2LvhBl_oelbsEQ79kyLU8wDO7PBNC50PMy1YLs4f0,11093
17
17
  gazu/playlist.py,sha256=fzrhVY0fhxp5rSlvrowZPWEOqdl4rEYD4TKmnuvyKHg,6740
18
- gazu/project.py,sha256=fssI_Bf5UqqRd9bfM68oyfkhjxwWvjdiAcYvvUhI5LY,12649
18
+ gazu/project.py,sha256=wqA3-C1LeS3MsMP198pSapH-47FA8V9ciIaq0Q_OBNw,12662
19
19
  gazu/scene.py,sha256=Q4AVmiMfGhSZfaXwOceyR-taTlpx1WCELe0UBSiHm8o,5357
20
20
  gazu/shot.py,sha256=mHg-8B7xk3PXMqbPo0oCx2X7br2sGCBmuM7hEhpXRas,18942
21
21
  gazu/sorting.py,sha256=qSIO0pOHkj0Tl4gm9BJrYrcifWGGGmsW68Pl86zB_bg,266
22
22
  gazu/sync.py,sha256=3clThVFC9pSIQiCyVkNRPnlbYQDA2kfR-lxaWxHbeUk,21611
23
- gazu/task.py,sha256=_b30VF0ZooB-WTNoCYslJWzT0NI0RF8MZ31h8B4A218,38001
23
+ gazu/task.py,sha256=CsWS5II9b4Pbe4fcLt3HmUTvUD1hvZw7Uulqcp4W2_Y,38645
24
24
  gazu/user.py,sha256=GyJf6mrynHvLllw3Hsiv-6wjaYTHO_PBNkJzyJjJA1A,9556
25
- gazu-0.10.26.dist-info/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
26
- gazu-0.10.26.dist-info/METADATA,sha256=qe_4qpfZzRwvAsDztt_la1H7Uw_FMOiiU5gKyN8TdBc,5471
27
- gazu-0.10.26.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
28
- gazu-0.10.26.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
29
- gazu-0.10.26.dist-info/RECORD,,
25
+ gazu-0.10.28.dist-info/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
26
+ gazu-0.10.28.dist-info/METADATA,sha256=vAVOrU7LQ3XdFre-8rZUd-RzN2xB7V5UWoLrqsVKPMM,5471
27
+ gazu-0.10.28.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
28
+ gazu-0.10.28.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
29
+ gazu-0.10.28.dist-info/RECORD,,
File without changes