gazu 0.10.15__tar.gz → 0.10.16__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.15 → gazu-0.10.16}/PKG-INFO +3 -3
  2. gazu-0.10.16/gazu/__version__.py +1 -0
  3. {gazu-0.10.15 → gazu-0.10.16}/gazu/casting.py +4 -1
  4. {gazu-0.10.15 → gazu-0.10.16}/gazu/playlist.py +11 -21
  5. {gazu-0.10.15 → gazu-0.10.16}/gazu/task.py +3 -23
  6. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/PKG-INFO +3 -3
  7. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/requires.txt +2 -2
  8. {gazu-0.10.15 → gazu-0.10.16}/setup.cfg +2 -2
  9. {gazu-0.10.15 → gazu-0.10.16}/tests/test_casting.py +3 -1
  10. {gazu-0.10.15 → gazu-0.10.16}/tests/test_playlist.py +27 -19
  11. gazu-0.10.15/gazu/__version__.py +0 -1
  12. {gazu-0.10.15 → gazu-0.10.16}/LICENSE +0 -0
  13. {gazu-0.10.15 → gazu-0.10.16}/README.rst +0 -0
  14. {gazu-0.10.15 → gazu-0.10.16}/gazu/__init__.py +0 -0
  15. {gazu-0.10.15 → gazu-0.10.16}/gazu/asset.py +0 -0
  16. {gazu-0.10.15 → gazu-0.10.16}/gazu/cache.py +0 -0
  17. {gazu-0.10.15 → gazu-0.10.16}/gazu/client.py +0 -0
  18. {gazu-0.10.15 → gazu-0.10.16}/gazu/concept.py +0 -0
  19. {gazu-0.10.15 → gazu-0.10.16}/gazu/context.py +0 -0
  20. {gazu-0.10.15 → gazu-0.10.16}/gazu/edit.py +0 -0
  21. {gazu-0.10.15 → gazu-0.10.16}/gazu/encoder.py +0 -0
  22. {gazu-0.10.15 → gazu-0.10.16}/gazu/entity.py +0 -0
  23. {gazu-0.10.15 → gazu-0.10.16}/gazu/events.py +0 -0
  24. {gazu-0.10.15 → gazu-0.10.16}/gazu/exception.py +0 -0
  25. {gazu-0.10.15 → gazu-0.10.16}/gazu/files.py +0 -0
  26. {gazu-0.10.15 → gazu-0.10.16}/gazu/helpers.py +0 -0
  27. {gazu-0.10.15 → gazu-0.10.16}/gazu/person.py +0 -0
  28. {gazu-0.10.15 → gazu-0.10.16}/gazu/project.py +0 -0
  29. {gazu-0.10.15 → gazu-0.10.16}/gazu/scene.py +0 -0
  30. {gazu-0.10.15 → gazu-0.10.16}/gazu/shot.py +0 -0
  31. {gazu-0.10.15 → gazu-0.10.16}/gazu/sorting.py +0 -0
  32. {gazu-0.10.15 → gazu-0.10.16}/gazu/sync.py +0 -0
  33. {gazu-0.10.15 → gazu-0.10.16}/gazu/user.py +0 -0
  34. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/SOURCES.txt +0 -0
  35. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/dependency_links.txt +0 -0
  36. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/not-zip-safe +0 -0
  37. {gazu-0.10.15 → gazu-0.10.16}/gazu.egg-info/top_level.txt +0 -0
  38. {gazu-0.10.15 → gazu-0.10.16}/pyproject.toml +0 -0
  39. {gazu-0.10.15 → gazu-0.10.16}/setup.py +0 -0
  40. {gazu-0.10.15 → gazu-0.10.16}/tests/test_asset.py +0 -0
  41. {gazu-0.10.15 → gazu-0.10.16}/tests/test_cache.py +0 -0
  42. {gazu-0.10.15 → gazu-0.10.16}/tests/test_client.py +0 -0
  43. {gazu-0.10.15 → gazu-0.10.16}/tests/test_concept.py +0 -0
  44. {gazu-0.10.15 → gazu-0.10.16}/tests/test_context.py +0 -0
  45. {gazu-0.10.15 → gazu-0.10.16}/tests/test_edit.py +0 -0
  46. {gazu-0.10.15 → gazu-0.10.16}/tests/test_entity.py +0 -0
  47. {gazu-0.10.15 → gazu-0.10.16}/tests/test_files.py +0 -0
  48. {gazu-0.10.15 → gazu-0.10.16}/tests/test_helpers.py +0 -0
  49. {gazu-0.10.15 → gazu-0.10.16}/tests/test_person.py +0 -0
  50. {gazu-0.10.15 → gazu-0.10.16}/tests/test_project.py +0 -0
  51. {gazu-0.10.15 → gazu-0.10.16}/tests/test_scene.py +0 -0
  52. {gazu-0.10.15 → gazu-0.10.16}/tests/test_shot.py +0 -0
  53. {gazu-0.10.15 → gazu-0.10.16}/tests/test_sync.py +0 -0
  54. {gazu-0.10.15 → gazu-0.10.16}/tests/test_task.py +0 -0
  55. {gazu-0.10.15 → gazu-0.10.16}/tests/test_user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gazu
3
- Version: 0.10.15
3
+ Version: 0.10.16
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
@@ -36,8 +36,8 @@ Requires-Dist: pytest-cov; extra == "test"
36
36
  Requires-Dist: requests_mock; extra == "test"
37
37
  Provides-Extra: lint
38
38
  Requires-Dist: autoflake==2.3.1; python_version >= "3.8" and extra == "lint"
39
- Requires-Dist: black==24.8.0; python_version >= "3.8" and extra == "lint"
40
- Requires-Dist: pre-commit==3.8.0; python_version >= "3.9" and extra == "lint"
39
+ Requires-Dist: black==24.10.0; python_version >= "3.9" and extra == "lint"
40
+ Requires-Dist: pre-commit==4.0.1; python_version >= "3.9" and extra == "lint"
41
41
 
42
42
  .. figure:: https://zou.cg-wire.com/kitsu.png
43
43
  :alt: Kitsu Logo
@@ -0,0 +1 @@
1
+ __version__ = "0.10.16"
@@ -60,7 +60,10 @@ def update_episode_casting(project, episode, casting, client=default):
60
60
  """
61
61
  episode = normalize_model_parameter(episode)
62
62
  project = normalize_model_parameter(project)
63
- path = "data/projects/%s/entities/%s/casting" % (project["id"], episode["id"])
63
+ path = "data/projects/%s/entities/%s/casting" % (
64
+ project["id"],
65
+ episode["id"],
66
+ )
64
67
  return raw.put(path, casting, client=client)
65
68
 
66
69
 
@@ -166,16 +166,12 @@ def get_entity_preview_files(entity, client=default):
166
166
  entity = normalize_model_parameter(entity)
167
167
  return raw.get(
168
168
  "data/playlists/entities/%s/preview-files" % entity["id"],
169
- client=client
169
+ client=client,
170
170
  )
171
171
 
172
172
 
173
173
  def add_entity_to_playlist(
174
- playlist,
175
- entity,
176
- preview_file=None,
177
- persist=True,
178
- client=default
174
+ playlist, entity, preview_file=None, persist=True, client=default
179
175
  ):
180
176
  """
181
177
  Add an entity to the playlist, use the last uploaded preview as revision
@@ -197,25 +193,23 @@ def add_entity_to_playlist(
197
193
  for task_type_id in preview_files.keys():
198
194
  task_type_files = preview_files[task_type_id]
199
195
  first_file = task_type_files[0]
200
- if preview_file is None or \
201
- preview_file["created_at"] < first_file["created_at"]:
196
+ if (
197
+ preview_file is None
198
+ or preview_file["created_at"] < first_file["created_at"]
199
+ ):
202
200
  preview_file = first_file
203
201
 
204
202
  preview_file = normalize_model_parameter(preview_file)
205
- playlist["shots"].append({
206
- "entity_id": entity["id"],
207
- "preview_file_id": preview_file["id"]
208
- })
203
+ playlist["shots"].append(
204
+ {"entity_id": entity["id"], "preview_file_id": preview_file["id"]}
205
+ )
209
206
  if persist:
210
207
  update_playlist(playlist, client=client)
211
208
  return playlist
212
209
 
213
210
 
214
211
  def remove_entity_from_playlist(
215
- playlist,
216
- entity,
217
- persist=True,
218
- client=default
212
+ playlist, entity, persist=True, client=default
219
213
  ):
220
214
  """
221
215
  Remove all occurences of a given entity from a playlist.
@@ -239,11 +233,7 @@ def remove_entity_from_playlist(
239
233
 
240
234
 
241
235
  def update_entity_preview(
242
- playlist,
243
- entity,
244
- preview_file,
245
- persist=True,
246
- client=default
236
+ playlist, entity, preview_file, persist=True, client=default
247
237
  ):
248
238
  """
249
239
  Remove all occurences of a given entity from a playlist.
@@ -257,12 +257,7 @@ def all_tasks_for_task_status(project, task_type, task_status, client=default):
257
257
 
258
258
 
259
259
  @cache
260
- def all_tasks_for_task_type(
261
- project,
262
- task_type,
263
- episode=None,
264
- client=default
265
- ):
260
+ def all_tasks_for_task_type(project, task_type, episode=None, client=default):
266
261
  """
267
262
  Args:
268
263
  project (str / dict): The project dict or the project ID.
@@ -532,18 +527,6 @@ def get_task_status_by_name(name, client=default):
532
527
  return raw.fetch_first("task-status", {"name": name}, client=client)
533
528
 
534
529
 
535
- @cache
536
- def get_default_task_status(client=default):
537
- """
538
- Args:
539
- name (str / dict): The name of claimed task status.
540
-
541
- Returns:
542
- dict: Task status matching given name.
543
- """
544
- return raw.fetch_first("task-status", {"is_default": True}, client=client)
545
-
546
-
547
530
  @cache
548
531
  def get_task_status_by_short_name(task_status_short_name, client=default):
549
532
  """
@@ -661,7 +644,7 @@ def new_task(
661
644
  entity = normalize_model_parameter(entity)
662
645
  task_type = normalize_model_parameter(task_type)
663
646
  if task_status is None:
664
- task_status = get_default_task_status()
647
+ task_status = get_default_task_status(client=client)
665
648
 
666
649
  data = {
667
650
  "project_id": entity["project_id"],
@@ -1267,10 +1250,7 @@ def get_task_url(task, client=default):
1267
1250
 
1268
1251
 
1269
1252
  def all_tasks_for_project(
1270
- project,
1271
- task_type=None,
1272
- episode=None,
1273
- client=default
1253
+ project, task_type=None, episode=None, client=default
1274
1254
  ):
1275
1255
  """
1276
1256
  Args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gazu
3
- Version: 0.10.15
3
+ Version: 0.10.16
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
@@ -36,8 +36,8 @@ Requires-Dist: pytest-cov; extra == "test"
36
36
  Requires-Dist: requests_mock; extra == "test"
37
37
  Provides-Extra: lint
38
38
  Requires-Dist: autoflake==2.3.1; python_version >= "3.8" and extra == "lint"
39
- Requires-Dist: black==24.8.0; python_version >= "3.8" and extra == "lint"
40
- Requires-Dist: pre-commit==3.8.0; python_version >= "3.9" and extra == "lint"
39
+ Requires-Dist: black==24.10.0; python_version >= "3.9" and extra == "lint"
40
+ Requires-Dist: pre-commit==4.0.1; python_version >= "3.9" and extra == "lint"
41
41
 
42
42
  .. figure:: https://zou.cg-wire.com/kitsu.png
43
43
  :alt: Kitsu Logo
@@ -11,10 +11,10 @@ wheel
11
11
 
12
12
  [lint:python_version >= "3.8"]
13
13
  autoflake==2.3.1
14
- black==24.8.0
15
14
 
16
15
  [lint:python_version >= "3.9"]
17
- pre-commit==3.8.0
16
+ black==24.10.0
17
+ pre-commit==4.0.1
18
18
 
19
19
  [test]
20
20
  pytest
@@ -46,8 +46,8 @@ test =
46
46
  requests_mock
47
47
  lint =
48
48
  autoflake==2.3.1; python_version >= '3.8'
49
- black==24.8.0; python_version >= '3.8'
50
- pre-commit==3.8.0; python_version >= '3.9'
49
+ black==24.10.0; python_version >= '3.9'
50
+ pre-commit==4.0.1; python_version >= '3.9'
51
51
 
52
52
  [bdist_wheel]
53
53
  universal = 1
@@ -47,7 +47,9 @@ class CastingTestCase(unittest.TestCase):
47
47
  mock.put(gazu.client.get_full_url(path), text=json.dumps(casting))
48
48
  episode = {"id": fakeid("episode-01")}
49
49
  project = {"id": fakeid("project-01")}
50
- casting = gazu.casting.update_episode_casting(project, episode, casting)
50
+ casting = gazu.casting.update_episode_casting(
51
+ project, episode, casting
52
+ )
51
53
  self.assertEqual(casting[0]["asset_id"], fakeid("asset-1"))
52
54
 
53
55
  def test_get_asset_type_casting(self):
@@ -179,7 +179,8 @@ class TaskTestCase(unittest.TestCase):
179
179
  )
180
180
  mock.get(
181
181
  gazu.client.get_full_url(
182
- "data/playlists/entities/%s/preview-files" % fakeid("shot-1")
182
+ "data/playlists/entities/%s/preview-files"
183
+ % fakeid("shot-1")
183
184
  ),
184
185
  text=json.dumps(
185
186
  {fakeid("task-type-1"): [{"id": fakeid("preview-1")}]}
@@ -188,26 +189,33 @@ class TaskTestCase(unittest.TestCase):
188
189
  playlist = {
189
190
  "id": fakeid("playlist-1"),
190
191
  "name": "name_changed",
191
- "shots": []
192
- }
193
- shot = {
194
- "id": fakeid("shot-1"),
195
- "name": "SH01"
192
+ "shots": [],
196
193
  }
194
+ shot = {"id": fakeid("shot-1"), "name": "SH01"}
197
195
  playlist = gazu.playlist.add_entity_to_playlist(playlist, shot)
198
196
  self.assertEqual(playlist["id"], fakeid("playlist-1"))
199
- self.assertEqual(playlist["shots"], [{
200
- "entity_id": fakeid("shot-1"),
201
- "preview_file_id": fakeid("preview-1")
202
- }])
197
+ self.assertEqual(
198
+ playlist["shots"],
199
+ [
200
+ {
201
+ "entity_id": fakeid("shot-1"),
202
+ "preview_file_id": fakeid("preview-1"),
203
+ }
204
+ ],
205
+ )
203
206
  playlist = gazu.playlist.update_entity_preview(
204
- playlist,
205
- shot,
206
- fakeid("preview-2")
207
- )
208
- self.assertEqual(playlist["shots"], [{
209
- "entity_id": fakeid("shot-1"),
210
- "preview_file_id": fakeid("preview-2")
211
- }])
212
- playlist = gazu.playlist.remove_entity_from_playlist(playlist, shot)
207
+ playlist, shot, fakeid("preview-2")
208
+ )
209
+ self.assertEqual(
210
+ playlist["shots"],
211
+ [
212
+ {
213
+ "entity_id": fakeid("shot-1"),
214
+ "preview_file_id": fakeid("preview-2"),
215
+ }
216
+ ],
217
+ )
218
+ playlist = gazu.playlist.remove_entity_from_playlist(
219
+ playlist, shot
220
+ )
213
221
  self.assertEqual(playlist["shots"], [])
@@ -1 +0,0 @@
1
- __version__ = "0.10.15"
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