gazu 0.10.29__tar.gz → 0.10.31__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.29 → gazu-0.10.31}/PKG-INFO +1 -1
  2. gazu-0.10.31/gazu/__version__.py +1 -0
  3. {gazu-0.10.29 → gazu-0.10.31}/gazu/files.py +31 -1
  4. {gazu-0.10.29 → gazu-0.10.31}/gazu/shot.py +2 -2
  5. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/PKG-INFO +1 -1
  6. {gazu-0.10.29 → gazu-0.10.31}/tests/test_files.py +38 -0
  7. gazu-0.10.29/gazu/__version__.py +0 -1
  8. {gazu-0.10.29 → gazu-0.10.31}/LICENSE +0 -0
  9. {gazu-0.10.29 → gazu-0.10.31}/README.rst +0 -0
  10. {gazu-0.10.29 → gazu-0.10.31}/gazu/__init__.py +0 -0
  11. {gazu-0.10.29 → gazu-0.10.31}/gazu/asset.py +0 -0
  12. {gazu-0.10.29 → gazu-0.10.31}/gazu/cache.py +0 -0
  13. {gazu-0.10.29 → gazu-0.10.31}/gazu/casting.py +0 -0
  14. {gazu-0.10.29 → gazu-0.10.31}/gazu/client.py +0 -0
  15. {gazu-0.10.29 → gazu-0.10.31}/gazu/concept.py +0 -0
  16. {gazu-0.10.29 → gazu-0.10.31}/gazu/context.py +0 -0
  17. {gazu-0.10.29 → gazu-0.10.31}/gazu/edit.py +0 -0
  18. {gazu-0.10.29 → gazu-0.10.31}/gazu/encoder.py +0 -0
  19. {gazu-0.10.29 → gazu-0.10.31}/gazu/entity.py +0 -0
  20. {gazu-0.10.29 → gazu-0.10.31}/gazu/events.py +0 -0
  21. {gazu-0.10.29 → gazu-0.10.31}/gazu/exception.py +0 -0
  22. {gazu-0.10.29 → gazu-0.10.31}/gazu/helpers.py +0 -0
  23. {gazu-0.10.29 → gazu-0.10.31}/gazu/person.py +0 -0
  24. {gazu-0.10.29 → gazu-0.10.31}/gazu/playlist.py +0 -0
  25. {gazu-0.10.29 → gazu-0.10.31}/gazu/project.py +0 -0
  26. {gazu-0.10.29 → gazu-0.10.31}/gazu/scene.py +0 -0
  27. {gazu-0.10.29 → gazu-0.10.31}/gazu/sorting.py +0 -0
  28. {gazu-0.10.29 → gazu-0.10.31}/gazu/sync.py +0 -0
  29. {gazu-0.10.29 → gazu-0.10.31}/gazu/task.py +0 -0
  30. {gazu-0.10.29 → gazu-0.10.31}/gazu/user.py +0 -0
  31. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/SOURCES.txt +0 -0
  32. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/dependency_links.txt +0 -0
  33. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/not-zip-safe +0 -0
  34. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/requires.txt +0 -0
  35. {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/top_level.txt +0 -0
  36. {gazu-0.10.29 → gazu-0.10.31}/pyproject.toml +0 -0
  37. {gazu-0.10.29 → gazu-0.10.31}/setup.cfg +0 -0
  38. {gazu-0.10.29 → gazu-0.10.31}/setup.py +0 -0
  39. {gazu-0.10.29 → gazu-0.10.31}/tests/test_asset.py +0 -0
  40. {gazu-0.10.29 → gazu-0.10.31}/tests/test_cache.py +0 -0
  41. {gazu-0.10.29 → gazu-0.10.31}/tests/test_casting.py +0 -0
  42. {gazu-0.10.29 → gazu-0.10.31}/tests/test_client.py +0 -0
  43. {gazu-0.10.29 → gazu-0.10.31}/tests/test_concept.py +0 -0
  44. {gazu-0.10.29 → gazu-0.10.31}/tests/test_context.py +0 -0
  45. {gazu-0.10.29 → gazu-0.10.31}/tests/test_edit.py +0 -0
  46. {gazu-0.10.29 → gazu-0.10.31}/tests/test_entity.py +0 -0
  47. {gazu-0.10.29 → gazu-0.10.31}/tests/test_helpers.py +0 -0
  48. {gazu-0.10.29 → gazu-0.10.31}/tests/test_person.py +0 -0
  49. {gazu-0.10.29 → gazu-0.10.31}/tests/test_playlist.py +0 -0
  50. {gazu-0.10.29 → gazu-0.10.31}/tests/test_project.py +0 -0
  51. {gazu-0.10.29 → gazu-0.10.31}/tests/test_scene.py +0 -0
  52. {gazu-0.10.29 → gazu-0.10.31}/tests/test_shot.py +0 -0
  53. {gazu-0.10.29 → gazu-0.10.31}/tests/test_sync.py +0 -0
  54. {gazu-0.10.29 → gazu-0.10.31}/tests/test_task.py +0 -0
  55. {gazu-0.10.29 → gazu-0.10.31}/tests/test_user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gazu
3
- Version: 0.10.29
3
+ Version: 0.10.31
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.31"
@@ -1281,7 +1281,7 @@ def upload_project_avatar(project, file_path, client=default):
1281
1281
  Upload given file as project avatar.
1282
1282
 
1283
1283
  Args:
1284
- project (str / dict): The project dict or the project ID.
1284
+ project (str / dict): The project dict or ID.
1285
1285
  file_path (str): Path of the file to upload as avatar.
1286
1286
  """
1287
1287
  path = (
@@ -1291,6 +1291,36 @@ def upload_project_avatar(project, file_path, client=default):
1291
1291
  return raw.upload(path, file_path, client=client)
1292
1292
 
1293
1293
 
1294
+ def download_organisation_avatar(organisation, file_path, client=default):
1295
+ """
1296
+ Download given organisation's avatar and save it at given location.
1297
+ Args:
1298
+ organisation (str / dict): The organisation dict or ID.
1299
+ file_path (str): Location on hard drive where to save the file.
1300
+ """
1301
+ organisation = normalize_model_parameter(organisation)
1302
+ return raw.download(
1303
+ "pictures/thumbnails/organisations/%s.png" % (organisation["id"]),
1304
+ file_path,
1305
+ client=client,
1306
+ )
1307
+
1308
+
1309
+ def upload_organisation_avatar(organisation, file_path, client=default):
1310
+ """
1311
+ Upload given file as organisation avatar.
1312
+
1313
+ Args:
1314
+ organisation (str / dict): The organisation dict or ID.
1315
+ file_path (str): Path of the file to upload as avatar.
1316
+ """
1317
+ path = (
1318
+ "/pictures/thumbnails/organisations/%s"
1319
+ % normalize_model_parameter(organisation)["id"]
1320
+ )
1321
+ return raw.upload(path, file_path, client=client)
1322
+
1323
+
1294
1324
  def update_preview(preview_file, data, client=default):
1295
1325
  """
1296
1326
  Update the data of given preview file.
@@ -68,7 +68,7 @@ def all_shots_for_sequence(sequence, client=default):
68
68
  def all_sequences_for_project(project, client=default):
69
69
  """
70
70
  Args:
71
- sequence (str / dict): The sequence dict or the sequence ID.
71
+ sequence (str / dict): The project dict or the project ID.
72
72
 
73
73
  Returns:
74
74
  list: Sequences from database for given project.
@@ -83,7 +83,7 @@ def all_sequences_for_project(project, client=default):
83
83
  def all_sequences_for_episode(episode, client=default):
84
84
  """
85
85
  Args:
86
- sequence (str / dict): The sequence dict or the sequence ID.
86
+ sequence (str / dict): The episode dict or the episode ID.
87
87
 
88
88
  Returns:
89
89
  list: Sequences which are children of given episode.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gazu
3
- Version: 0.10.29
3
+ Version: 0.10.31
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
@@ -1230,3 +1230,41 @@ class FilesTestCase(unittest.TestCase):
1230
1230
  ),
1231
1231
  {"id": fakeid("project-1")},
1232
1232
  )
1233
+
1234
+ def test_upload_organisation_avatar(self):
1235
+ with open("./tests/fixtures/v1.png", "rb") as test_file:
1236
+ with requests_mock.Mocker() as mock:
1237
+ mock_route(
1238
+ mock,
1239
+ "POST",
1240
+ "pictures/thumbnails/organisations/%s"
1241
+ % fakeid("organisation-1"),
1242
+ text={"id": fakeid("organisation-1")},
1243
+ )
1244
+
1245
+ add_verify_file_callback(mock, {"file": test_file.read()})
1246
+
1247
+ self.assertEqual(
1248
+ gazu.files.upload_organisation_avatar(
1249
+ fakeid("organisation-1"),
1250
+ "./tests/fixtures/v1.png",
1251
+ ),
1252
+ {"id": fakeid("organisation-1")},
1253
+ )
1254
+
1255
+ def test_download_organisation_avatar(self):
1256
+ with open("./tests/fixtures/v1.png", "rb") as thumbnail_file:
1257
+ with requests_mock.mock() as mock:
1258
+ path = "pictures/thumbnails/organisations/{}.png".format(
1259
+ fakeid("organisation-1")
1260
+ )
1261
+ mock.get(gazu.client.get_full_url(path), body=thumbnail_file)
1262
+ gazu.files.download_organisation_avatar(
1263
+ fakeid("organisation-1"), "./test.png"
1264
+ )
1265
+ self.assertTrue(os.path.exists("./test.png"))
1266
+ self.assertEqual(
1267
+ os.path.getsize("./test.png"),
1268
+ os.path.getsize("./tests/fixtures/v1.png"),
1269
+ )
1270
+ os.remove("./test.png")
@@ -1 +0,0 @@
1
- __version__ = "0.10.29"
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
File without changes
File without changes