gazu 0.10.28__tar.gz → 0.10.30__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.28 → gazu-0.10.30}/PKG-INFO +1 -1
  2. gazu-0.10.30/gazu/__version__.py +1 -0
  3. {gazu-0.10.28 → gazu-0.10.30}/gazu/files.py +31 -1
  4. {gazu-0.10.28 → gazu-0.10.30}/gazu/person.py +14 -0
  5. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/PKG-INFO +1 -1
  6. {gazu-0.10.28 → gazu-0.10.30}/tests/test_files.py +38 -0
  7. {gazu-0.10.28 → gazu-0.10.30}/tests/test_person.py +14 -0
  8. gazu-0.10.28/gazu/__version__.py +0 -1
  9. {gazu-0.10.28 → gazu-0.10.30}/LICENSE +0 -0
  10. {gazu-0.10.28 → gazu-0.10.30}/README.rst +0 -0
  11. {gazu-0.10.28 → gazu-0.10.30}/gazu/__init__.py +0 -0
  12. {gazu-0.10.28 → gazu-0.10.30}/gazu/asset.py +0 -0
  13. {gazu-0.10.28 → gazu-0.10.30}/gazu/cache.py +0 -0
  14. {gazu-0.10.28 → gazu-0.10.30}/gazu/casting.py +0 -0
  15. {gazu-0.10.28 → gazu-0.10.30}/gazu/client.py +0 -0
  16. {gazu-0.10.28 → gazu-0.10.30}/gazu/concept.py +0 -0
  17. {gazu-0.10.28 → gazu-0.10.30}/gazu/context.py +0 -0
  18. {gazu-0.10.28 → gazu-0.10.30}/gazu/edit.py +0 -0
  19. {gazu-0.10.28 → gazu-0.10.30}/gazu/encoder.py +0 -0
  20. {gazu-0.10.28 → gazu-0.10.30}/gazu/entity.py +0 -0
  21. {gazu-0.10.28 → gazu-0.10.30}/gazu/events.py +0 -0
  22. {gazu-0.10.28 → gazu-0.10.30}/gazu/exception.py +0 -0
  23. {gazu-0.10.28 → gazu-0.10.30}/gazu/helpers.py +0 -0
  24. {gazu-0.10.28 → gazu-0.10.30}/gazu/playlist.py +0 -0
  25. {gazu-0.10.28 → gazu-0.10.30}/gazu/project.py +0 -0
  26. {gazu-0.10.28 → gazu-0.10.30}/gazu/scene.py +0 -0
  27. {gazu-0.10.28 → gazu-0.10.30}/gazu/shot.py +0 -0
  28. {gazu-0.10.28 → gazu-0.10.30}/gazu/sorting.py +0 -0
  29. {gazu-0.10.28 → gazu-0.10.30}/gazu/sync.py +0 -0
  30. {gazu-0.10.28 → gazu-0.10.30}/gazu/task.py +0 -0
  31. {gazu-0.10.28 → gazu-0.10.30}/gazu/user.py +0 -0
  32. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/SOURCES.txt +0 -0
  33. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/dependency_links.txt +0 -0
  34. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/not-zip-safe +0 -0
  35. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/requires.txt +0 -0
  36. {gazu-0.10.28 → gazu-0.10.30}/gazu.egg-info/top_level.txt +0 -0
  37. {gazu-0.10.28 → gazu-0.10.30}/pyproject.toml +0 -0
  38. {gazu-0.10.28 → gazu-0.10.30}/setup.cfg +0 -0
  39. {gazu-0.10.28 → gazu-0.10.30}/setup.py +0 -0
  40. {gazu-0.10.28 → gazu-0.10.30}/tests/test_asset.py +0 -0
  41. {gazu-0.10.28 → gazu-0.10.30}/tests/test_cache.py +0 -0
  42. {gazu-0.10.28 → gazu-0.10.30}/tests/test_casting.py +0 -0
  43. {gazu-0.10.28 → gazu-0.10.30}/tests/test_client.py +0 -0
  44. {gazu-0.10.28 → gazu-0.10.30}/tests/test_concept.py +0 -0
  45. {gazu-0.10.28 → gazu-0.10.30}/tests/test_context.py +0 -0
  46. {gazu-0.10.28 → gazu-0.10.30}/tests/test_edit.py +0 -0
  47. {gazu-0.10.28 → gazu-0.10.30}/tests/test_entity.py +0 -0
  48. {gazu-0.10.28 → gazu-0.10.30}/tests/test_helpers.py +0 -0
  49. {gazu-0.10.28 → gazu-0.10.30}/tests/test_playlist.py +0 -0
  50. {gazu-0.10.28 → gazu-0.10.30}/tests/test_project.py +0 -0
  51. {gazu-0.10.28 → gazu-0.10.30}/tests/test_scene.py +0 -0
  52. {gazu-0.10.28 → gazu-0.10.30}/tests/test_shot.py +0 -0
  53. {gazu-0.10.28 → gazu-0.10.30}/tests/test_sync.py +0 -0
  54. {gazu-0.10.28 → gazu-0.10.30}/tests/test_task.py +0 -0
  55. {gazu-0.10.28 → gazu-0.10.30}/tests/test_user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gazu
3
- Version: 0.10.28
3
+ Version: 0.10.30
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.30"
@@ -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.
@@ -432,3 +432,17 @@ def change_password_for_person(person, password, client=default):
432
432
  {"password": password, "password_2": password},
433
433
  client=client,
434
434
  )
435
+
436
+
437
+ def invite_person(person, client=default):
438
+ """
439
+ Sends an email to given person to invite him/her to connect to Kitsu.
440
+
441
+ Args:
442
+ person (dict): The person to invite.
443
+ """
444
+ person = normalize_model_parameter(person)
445
+ return raw.get(
446
+ "actions/persons/%s/invite" % (person["id"]),
447
+ client=client,
448
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gazu
3
- Version: 0.10.28
3
+ Version: 0.10.30
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")
@@ -341,3 +341,17 @@ class PersonTestCase(unittest.TestCase):
341
341
  gazu.person.change_password_for_person(person_id, "password"),
342
342
  {"success": True},
343
343
  )
344
+
345
+ def test_invite_person(self):
346
+ with requests_mock.mock() as mock:
347
+ person_id = fakeid("person-1")
348
+ mock_route(
349
+ mock,
350
+ "GET",
351
+ "actions/persons/%s/invite" % person_id,
352
+ text={"success": True},
353
+ )
354
+ self.assertEqual(
355
+ gazu.person.invite_person(person_id),
356
+ {"success": True},
357
+ )
@@ -1 +0,0 @@
1
- __version__ = "0.10.28"
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