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.
- {gazu-0.10.29 → gazu-0.10.31}/PKG-INFO +1 -1
- gazu-0.10.31/gazu/__version__.py +1 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/files.py +31 -1
- {gazu-0.10.29 → gazu-0.10.31}/gazu/shot.py +2 -2
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/PKG-INFO +1 -1
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_files.py +38 -0
- gazu-0.10.29/gazu/__version__.py +0 -1
- {gazu-0.10.29 → gazu-0.10.31}/LICENSE +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/README.rst +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/__init__.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/asset.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/cache.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/casting.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/client.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/concept.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/context.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/edit.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/encoder.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/entity.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/events.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/exception.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/helpers.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/person.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/playlist.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/project.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/scene.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/sorting.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/sync.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/task.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu/user.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/SOURCES.txt +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/dependency_links.txt +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/not-zip-safe +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/requires.txt +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/gazu.egg-info/top_level.txt +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/pyproject.toml +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/setup.cfg +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/setup.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_asset.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_cache.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_casting.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_client.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_concept.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_context.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_edit.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_entity.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_helpers.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_person.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_playlist.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_project.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_scene.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_shot.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_sync.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_task.py +0 -0
- {gazu-0.10.29 → gazu-0.10.31}/tests/test_user.py +0 -0
|
@@ -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
|
|
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
|
|
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
|
|
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.
|
|
@@ -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")
|
gazu-0.10.29/gazu/__version__.py
DELETED
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|