gazu 0.10.26__tar.gz → 0.10.28__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.
Files changed (55) hide show
  1. {gazu-0.10.26 → gazu-0.10.28}/PKG-INFO +1 -1
  2. gazu-0.10.28/gazu/__version__.py +1 -0
  3. {gazu-0.10.26 → gazu-0.10.28}/gazu/person.py +2 -2
  4. {gazu-0.10.26 → gazu-0.10.28}/gazu/project.py +1 -1
  5. {gazu-0.10.26 → gazu-0.10.28}/gazu/task.py +28 -9
  6. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/PKG-INFO +1 -1
  7. {gazu-0.10.26 → gazu-0.10.28}/tests/test_person.py +2 -2
  8. {gazu-0.10.26 → gazu-0.10.28}/tests/test_task.py +22 -8
  9. gazu-0.10.26/gazu/__version__.py +0 -1
  10. {gazu-0.10.26 → gazu-0.10.28}/LICENSE +0 -0
  11. {gazu-0.10.26 → gazu-0.10.28}/README.rst +0 -0
  12. {gazu-0.10.26 → gazu-0.10.28}/gazu/__init__.py +0 -0
  13. {gazu-0.10.26 → gazu-0.10.28}/gazu/asset.py +0 -0
  14. {gazu-0.10.26 → gazu-0.10.28}/gazu/cache.py +0 -0
  15. {gazu-0.10.26 → gazu-0.10.28}/gazu/casting.py +0 -0
  16. {gazu-0.10.26 → gazu-0.10.28}/gazu/client.py +0 -0
  17. {gazu-0.10.26 → gazu-0.10.28}/gazu/concept.py +0 -0
  18. {gazu-0.10.26 → gazu-0.10.28}/gazu/context.py +0 -0
  19. {gazu-0.10.26 → gazu-0.10.28}/gazu/edit.py +0 -0
  20. {gazu-0.10.26 → gazu-0.10.28}/gazu/encoder.py +0 -0
  21. {gazu-0.10.26 → gazu-0.10.28}/gazu/entity.py +0 -0
  22. {gazu-0.10.26 → gazu-0.10.28}/gazu/events.py +0 -0
  23. {gazu-0.10.26 → gazu-0.10.28}/gazu/exception.py +0 -0
  24. {gazu-0.10.26 → gazu-0.10.28}/gazu/files.py +0 -0
  25. {gazu-0.10.26 → gazu-0.10.28}/gazu/helpers.py +0 -0
  26. {gazu-0.10.26 → gazu-0.10.28}/gazu/playlist.py +0 -0
  27. {gazu-0.10.26 → gazu-0.10.28}/gazu/scene.py +0 -0
  28. {gazu-0.10.26 → gazu-0.10.28}/gazu/shot.py +0 -0
  29. {gazu-0.10.26 → gazu-0.10.28}/gazu/sorting.py +0 -0
  30. {gazu-0.10.26 → gazu-0.10.28}/gazu/sync.py +0 -0
  31. {gazu-0.10.26 → gazu-0.10.28}/gazu/user.py +0 -0
  32. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/SOURCES.txt +0 -0
  33. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/dependency_links.txt +0 -0
  34. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/not-zip-safe +0 -0
  35. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/requires.txt +0 -0
  36. {gazu-0.10.26 → gazu-0.10.28}/gazu.egg-info/top_level.txt +0 -0
  37. {gazu-0.10.26 → gazu-0.10.28}/pyproject.toml +0 -0
  38. {gazu-0.10.26 → gazu-0.10.28}/setup.cfg +0 -0
  39. {gazu-0.10.26 → gazu-0.10.28}/setup.py +0 -0
  40. {gazu-0.10.26 → gazu-0.10.28}/tests/test_asset.py +0 -0
  41. {gazu-0.10.26 → gazu-0.10.28}/tests/test_cache.py +0 -0
  42. {gazu-0.10.26 → gazu-0.10.28}/tests/test_casting.py +0 -0
  43. {gazu-0.10.26 → gazu-0.10.28}/tests/test_client.py +0 -0
  44. {gazu-0.10.26 → gazu-0.10.28}/tests/test_concept.py +0 -0
  45. {gazu-0.10.26 → gazu-0.10.28}/tests/test_context.py +0 -0
  46. {gazu-0.10.26 → gazu-0.10.28}/tests/test_edit.py +0 -0
  47. {gazu-0.10.26 → gazu-0.10.28}/tests/test_entity.py +0 -0
  48. {gazu-0.10.26 → gazu-0.10.28}/tests/test_files.py +0 -0
  49. {gazu-0.10.26 → gazu-0.10.28}/tests/test_helpers.py +0 -0
  50. {gazu-0.10.26 → gazu-0.10.28}/tests/test_playlist.py +0 -0
  51. {gazu-0.10.26 → gazu-0.10.28}/tests/test_project.py +0 -0
  52. {gazu-0.10.26 → gazu-0.10.28}/tests/test_scene.py +0 -0
  53. {gazu-0.10.26 → gazu-0.10.28}/tests/test_shot.py +0 -0
  54. {gazu-0.10.26 → gazu-0.10.28}/tests/test_sync.py +0 -0
  55. {gazu-0.10.26 → gazu-0.10.28}/tests/test_user.py +0 -0
@@ -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
@@ -0,0 +1 @@
1
+ __version__ = "0.10.28"
@@ -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
 
@@ -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
  )
@@ -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
@@ -244,11 +244,11 @@ class PersonTestCase(unittest.TestCase):
244
244
  mock_route(
245
245
  mock,
246
246
  "GET",
247
- "data/persons?id=%s&relations=False" % (fakeid("John Doe")),
247
+ "data/persons?id=%s&relations=True" % (fakeid("John Doe")),
248
248
  text=result,
249
249
  )
250
250
  self.assertEqual(
251
- gazu.person.get_person(fakeid("John Doe"), relations=False),
251
+ gazu.person.get_person(fakeid("John Doe"), relations=True),
252
252
  result[0],
253
253
  )
254
254
 
@@ -180,18 +180,32 @@ class TaskTestCase(unittest.TestCase):
180
180
 
181
181
  def test_get_task_type_by_name(self):
182
182
  with requests_mock.mock() as mock:
183
- mock.get(
184
- gazu.client.get_full_url("data/task-types"),
185
- text=json.dumps(
186
- [
187
- {"name": "FX", "id": "task-type-fx"},
188
- {"name": "Modeling", "id": "task-type-modeling"},
189
- ]
190
- ),
183
+ mock_route(
184
+ mock,
185
+ "GET",
186
+ "data/task-types",
187
+ text=[
188
+ {"name": "FX", "id": "task-type-fx"},
189
+ {"name": "Modeling", "id": "task-type-modeling"},
190
+ ],
191
191
  )
192
192
  task_type = gazu.task.get_task_type_by_name("FX")
193
193
  self.assertEqual(task_type["name"], "FX")
194
194
 
195
+ def test_get_task_type_by_short_name(self):
196
+ with requests_mock.mock() as mock:
197
+ mock_route(
198
+ mock,
199
+ "GET",
200
+ "data/task-types",
201
+ text=[
202
+ {"name": "FX", "id": "task-type-fx"},
203
+ {"name": "Modeling", "id": "task-type-modeling"},
204
+ ],
205
+ )
206
+ task_type = gazu.task.get_task_type_by_short_name("FX")
207
+ self.assertEqual(task_type["name"], "FX")
208
+
195
209
  def test_get_task_by_path(self):
196
210
  with requests_mock.mock() as mock:
197
211
  file_path = "/simple/SE01/S01/animation/blocking"
@@ -1 +0,0 @@
1
- __version__ = "0.10.26"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes