gazu 1.1.1__py2.py3-none-any.whl → 1.1.2__py2.py3-none-any.whl
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/__version__.py +1 -1
- gazu/asset.py +25 -33
- gazu/casting.py +16 -41
- gazu/client.py +6 -6
- gazu/concept.py +5 -5
- gazu/edit.py +11 -14
- gazu/entity.py +3 -3
- gazu/files.py +51 -110
- gazu/helpers.py +2 -4
- gazu/person.py +24 -27
- gazu/playlist.py +13 -24
- gazu/project.py +37 -50
- gazu/scene.py +13 -15
- gazu/shot.py +35 -45
- gazu/task.py +77 -97
- gazu/user.py +27 -30
- {gazu-1.1.1.dist-info → gazu-1.1.2.dist-info}/METADATA +2 -2
- gazu-1.1.2.dist-info/RECORD +31 -0
- {gazu-1.1.1.dist-info → gazu-1.1.2.dist-info}/WHEEL +1 -1
- gazu-1.1.1.dist-info/RECORD +0 -31
- {gazu-1.1.1.dist-info → gazu-1.1.2.dist-info}/licenses/LICENSE +0 -0
- {gazu-1.1.1.dist-info → gazu-1.1.2.dist-info}/top_level.txt +0 -0
gazu/task.py
CHANGED
|
@@ -54,7 +54,7 @@ def all_task_types_for_project(
|
|
|
54
54
|
"""
|
|
55
55
|
project = normalize_model_parameter(project)
|
|
56
56
|
task_types = raw.fetch_all(
|
|
57
|
-
"projects
|
|
57
|
+
f"projects/{project['id']}/task-types", client=client
|
|
58
58
|
)
|
|
59
59
|
return sort_by_name(task_types)
|
|
60
60
|
|
|
@@ -69,7 +69,7 @@ def all_task_statuses_for_project(
|
|
|
69
69
|
"""
|
|
70
70
|
project = normalize_model_parameter(project)
|
|
71
71
|
task_statuses = raw.fetch_all(
|
|
72
|
-
"projects
|
|
72
|
+
f"projects/{project['id']}/settings/task-status", client=client
|
|
73
73
|
)
|
|
74
74
|
return sort_by_name(task_statuses)
|
|
75
75
|
|
|
@@ -89,7 +89,7 @@ def all_tasks_for_shot(
|
|
|
89
89
|
params = {}
|
|
90
90
|
if relations:
|
|
91
91
|
params = {"relations": True}
|
|
92
|
-
tasks = raw.fetch_all("shots
|
|
92
|
+
tasks = raw.fetch_all(f"shots/{shot['id']}/tasks", params, client=client)
|
|
93
93
|
return sort_by_name(tasks)
|
|
94
94
|
|
|
95
95
|
|
|
@@ -109,7 +109,7 @@ def all_tasks_for_concept(
|
|
|
109
109
|
if relations:
|
|
110
110
|
params = {"relations": True}
|
|
111
111
|
tasks = raw.fetch_all(
|
|
112
|
-
"concepts
|
|
112
|
+
f"concepts/{concept['id']}/tasks", params, client=client
|
|
113
113
|
)
|
|
114
114
|
return sort_by_name(tasks)
|
|
115
115
|
|
|
@@ -129,7 +129,7 @@ def all_tasks_for_edit(
|
|
|
129
129
|
params = {}
|
|
130
130
|
if relations:
|
|
131
131
|
params = {"relations": True}
|
|
132
|
-
tasks = raw.fetch_all("edits
|
|
132
|
+
tasks = raw.fetch_all(f"edits/{edit['id']}/tasks", params, client=client)
|
|
133
133
|
return sort_by_name(tasks)
|
|
134
134
|
|
|
135
135
|
|
|
@@ -150,7 +150,7 @@ def all_tasks_for_sequence(
|
|
|
150
150
|
params = {}
|
|
151
151
|
if relations:
|
|
152
152
|
params = {"relations": True}
|
|
153
|
-
path = "sequences
|
|
153
|
+
path = f"sequences/{sequence['id']}/tasks"
|
|
154
154
|
tasks = raw.fetch_all(path, params, client=client)
|
|
155
155
|
return sort_by_name(tasks)
|
|
156
156
|
|
|
@@ -170,7 +170,7 @@ def all_tasks_for_scene(
|
|
|
170
170
|
params = {}
|
|
171
171
|
if relations:
|
|
172
172
|
params = {"relations": True}
|
|
173
|
-
path = "scenes
|
|
173
|
+
path = f"scenes/{scene['id']}/tasks"
|
|
174
174
|
tasks = raw.fetch_all(path, params, client=client)
|
|
175
175
|
return sort_by_name(tasks)
|
|
176
176
|
|
|
@@ -190,7 +190,7 @@ def all_tasks_for_asset(
|
|
|
190
190
|
params = {}
|
|
191
191
|
if relations:
|
|
192
192
|
params = {"relations": True}
|
|
193
|
-
path = "assets
|
|
193
|
+
path = f"assets/{asset['id']}/tasks"
|
|
194
194
|
tasks = raw.fetch_all(path, params, client=client)
|
|
195
195
|
return sort_by_name(tasks)
|
|
196
196
|
|
|
@@ -206,7 +206,7 @@ def all_tasks_for_episode(
|
|
|
206
206
|
params = {}
|
|
207
207
|
if relations:
|
|
208
208
|
params = {"relations": True}
|
|
209
|
-
path = "episodes
|
|
209
|
+
path = f"episodes/{episode['id']}/tasks"
|
|
210
210
|
tasks = raw.fetch_all(path, params, client=client)
|
|
211
211
|
return sort_by_name(tasks)
|
|
212
212
|
|
|
@@ -224,7 +224,7 @@ def all_shot_tasks_for_sequence(
|
|
|
224
224
|
params = {}
|
|
225
225
|
if relations:
|
|
226
226
|
params = {"relations": True}
|
|
227
|
-
path = "sequences
|
|
227
|
+
path = f"sequences/{sequence['id']}/shot-tasks"
|
|
228
228
|
tasks = raw.fetch_all(path, params, client=client)
|
|
229
229
|
return sort_by_name(tasks)
|
|
230
230
|
|
|
@@ -240,7 +240,7 @@ def all_shot_tasks_for_episode(
|
|
|
240
240
|
params = {}
|
|
241
241
|
if relations:
|
|
242
242
|
params = {"relations": True}
|
|
243
|
-
path = "episodes
|
|
243
|
+
path = f"episodes/{episode['id']}/shot-tasks"
|
|
244
244
|
tasks = raw.fetch_all(path, params, client=client)
|
|
245
245
|
return sort_by_name(tasks)
|
|
246
246
|
|
|
@@ -256,7 +256,7 @@ def all_assets_tasks_for_episode(
|
|
|
256
256
|
params = {}
|
|
257
257
|
if relations:
|
|
258
258
|
params = {"relations": True}
|
|
259
|
-
path = "episodes
|
|
259
|
+
path = f"episodes/{episode['id']}/asset-tasks"
|
|
260
260
|
tasks = raw.fetch_all(path, params, client=client)
|
|
261
261
|
return sort_by_name(tasks)
|
|
262
262
|
|
|
@@ -331,7 +331,7 @@ def all_task_types_for_shot(
|
|
|
331
331
|
list: Task types of task linked to given shot.
|
|
332
332
|
"""
|
|
333
333
|
shot = normalize_model_parameter(shot)
|
|
334
|
-
path = "shots
|
|
334
|
+
path = f"shots/{shot['id']}/task-types"
|
|
335
335
|
task_types = raw.fetch_all(path, client=client)
|
|
336
336
|
return sort_by_name(task_types)
|
|
337
337
|
|
|
@@ -348,7 +348,7 @@ def all_task_types_for_concept(
|
|
|
348
348
|
list: Task types of task linked to given concept.
|
|
349
349
|
"""
|
|
350
350
|
concept = normalize_model_parameter(concept)
|
|
351
|
-
path = "concepts
|
|
351
|
+
path = f"concepts/{concept['id']}/task-types"
|
|
352
352
|
task_types = raw.fetch_all(path, client=client)
|
|
353
353
|
return sort_by_name(task_types)
|
|
354
354
|
|
|
@@ -366,7 +366,7 @@ def all_task_types_for_asset(
|
|
|
366
366
|
"""
|
|
367
367
|
asset = normalize_model_parameter(asset)
|
|
368
368
|
task_types = raw.fetch_all(
|
|
369
|
-
"assets
|
|
369
|
+
f"assets/{asset['id']}/task-types", client=client
|
|
370
370
|
)
|
|
371
371
|
return sort_by_name(task_types)
|
|
372
372
|
|
|
@@ -383,7 +383,7 @@ def all_task_types_for_scene(
|
|
|
383
383
|
list: Task types of tasks linked to given scene.
|
|
384
384
|
"""
|
|
385
385
|
scene = normalize_model_parameter(scene)
|
|
386
|
-
path = "scenes
|
|
386
|
+
path = f"scenes/{scene['id']}/task-types"
|
|
387
387
|
task_types = raw.fetch_all(path, client=client)
|
|
388
388
|
return sort_by_name(task_types)
|
|
389
389
|
|
|
@@ -400,7 +400,7 @@ def all_task_types_for_sequence(
|
|
|
400
400
|
list: Task types of tasks linked directly to given sequence.
|
|
401
401
|
"""
|
|
402
402
|
sequence = normalize_model_parameter(sequence)
|
|
403
|
-
path = "sequences
|
|
403
|
+
path = f"sequences/{sequence['id']}/task-types"
|
|
404
404
|
task_types = raw.fetch_all(path, client=client)
|
|
405
405
|
return sort_by_name(task_types)
|
|
406
406
|
|
|
@@ -414,7 +414,7 @@ def all_task_types_for_episode(
|
|
|
414
414
|
list: Task types of tasks linked directly to given episode.
|
|
415
415
|
"""
|
|
416
416
|
episode = normalize_model_parameter(episode)
|
|
417
|
-
path = "episodes
|
|
417
|
+
path = f"episodes/{episode['id']}/task-types"
|
|
418
418
|
task_types = raw.fetch_all(path, client=client)
|
|
419
419
|
return sort_by_name(task_types)
|
|
420
420
|
|
|
@@ -435,7 +435,7 @@ def all_tasks_for_entity_and_task_type(
|
|
|
435
435
|
task_type = normalize_model_parameter(task_type)
|
|
436
436
|
task_type_id = task_type["id"]
|
|
437
437
|
entity_id = entity["id"]
|
|
438
|
-
path = "entities
|
|
438
|
+
path = f"entities/{entity_id}/task-types/{task_type_id}/tasks"
|
|
439
439
|
return raw.fetch_all(path, client=client)
|
|
440
440
|
|
|
441
441
|
|
|
@@ -448,7 +448,7 @@ def all_tasks_for_person(
|
|
|
448
448
|
list: Tasks that are not done for given person (only for open projects).
|
|
449
449
|
"""
|
|
450
450
|
person = normalize_model_parameter(person)
|
|
451
|
-
return raw.fetch_all("persons
|
|
451
|
+
return raw.fetch_all(f"persons/{person['id']}/tasks", client=client)
|
|
452
452
|
|
|
453
453
|
|
|
454
454
|
@cache
|
|
@@ -460,7 +460,7 @@ def all_done_tasks_for_person(
|
|
|
460
460
|
list: Tasks that are done for given person (only for open projects).
|
|
461
461
|
"""
|
|
462
462
|
person = normalize_model_parameter(person)
|
|
463
|
-
return raw.fetch_all("persons
|
|
463
|
+
return raw.fetch_all(f"persons/{person['id']}/done-tasks", client=client)
|
|
464
464
|
|
|
465
465
|
|
|
466
466
|
@cache
|
|
@@ -644,7 +644,7 @@ def remove_task_type(
|
|
|
644
644
|
"""
|
|
645
645
|
task_type = normalize_model_parameter(task_type)
|
|
646
646
|
return raw.delete(
|
|
647
|
-
"data/task-types
|
|
647
|
+
f"data/task-types/{task_type['id']}",
|
|
648
648
|
{"force": True},
|
|
649
649
|
client=client,
|
|
650
650
|
)
|
|
@@ -661,7 +661,7 @@ def remove_task_status(
|
|
|
661
661
|
"""
|
|
662
662
|
task_status = normalize_model_parameter(task_status)
|
|
663
663
|
return raw.delete(
|
|
664
|
-
"data/task-status
|
|
664
|
+
f"data/task-status/{task_status['id']}",
|
|
665
665
|
{"force": True},
|
|
666
666
|
client=client,
|
|
667
667
|
)
|
|
@@ -678,7 +678,7 @@ def update_task_type(task_type: dict, client: KitsuClient = default) -> dict:
|
|
|
678
678
|
dict: Updated task type.
|
|
679
679
|
"""
|
|
680
680
|
return raw.put(
|
|
681
|
-
"data/task-types
|
|
681
|
+
f"data/task-types/{task_type['id']}",
|
|
682
682
|
task_type,
|
|
683
683
|
client=client,
|
|
684
684
|
)
|
|
@@ -697,7 +697,7 @@ def update_task_status(
|
|
|
697
697
|
dict: Updated task status.
|
|
698
698
|
"""
|
|
699
699
|
return raw.put(
|
|
700
|
-
"data/task-status
|
|
700
|
+
f"data/task-status/{task_status['id']}",
|
|
701
701
|
task_status,
|
|
702
702
|
client=client,
|
|
703
703
|
)
|
|
@@ -713,7 +713,7 @@ def get_task(task_id: str | dict, client: KitsuClient = default) -> dict:
|
|
|
713
713
|
dict: Task matching given ID.
|
|
714
714
|
"""
|
|
715
715
|
task_id = normalize_model_parameter(task_id)
|
|
716
|
-
return raw.get("data/tasks
|
|
716
|
+
return raw.get(f"data/tasks/{task_id['id']}/full", client=client)
|
|
717
717
|
|
|
718
718
|
|
|
719
719
|
def new_task(
|
|
@@ -770,7 +770,7 @@ def remove_task(task: str | dict, client: KitsuClient = default) -> str:
|
|
|
770
770
|
task (str / dict): The task dict or the task ID.
|
|
771
771
|
"""
|
|
772
772
|
task = normalize_model_parameter(task)
|
|
773
|
-
raw.delete("data/tasks
|
|
773
|
+
raw.delete(f"data/tasks/{task['id']}", {"force": True}, client=client)
|
|
774
774
|
|
|
775
775
|
|
|
776
776
|
def start_task(
|
|
@@ -833,7 +833,7 @@ def task_to_review(
|
|
|
833
833
|
"""
|
|
834
834
|
task = normalize_model_parameter(task)
|
|
835
835
|
person = normalize_model_parameter(person)
|
|
836
|
-
path = "actions/tasks
|
|
836
|
+
path = f"actions/tasks/{task['id']}/to-review"
|
|
837
837
|
data = {
|
|
838
838
|
"person_id": person["id"],
|
|
839
839
|
"comment": comment,
|
|
@@ -861,9 +861,9 @@ def get_time_spent(
|
|
|
861
861
|
dict: A dict with person ID as key and time spent object as value.
|
|
862
862
|
"""
|
|
863
863
|
task = normalize_model_parameter(task)
|
|
864
|
-
path = "actions/tasks
|
|
864
|
+
path = f"actions/tasks/{task['id']}/time-spents"
|
|
865
865
|
if date is not None:
|
|
866
|
-
path += "
|
|
866
|
+
path += f"/{date}"
|
|
867
867
|
return raw.get(path, client=client)
|
|
868
868
|
|
|
869
869
|
|
|
@@ -888,10 +888,8 @@ def set_time_spent(
|
|
|
888
888
|
"""
|
|
889
889
|
task = normalize_model_parameter(task)
|
|
890
890
|
person = normalize_model_parameter(person)
|
|
891
|
-
path =
|
|
892
|
-
task[
|
|
893
|
-
date,
|
|
894
|
-
person["id"],
|
|
891
|
+
path = (
|
|
892
|
+
f"actions/tasks/{task['id']}/time-spents/{date}/persons/{person['id']}"
|
|
895
893
|
)
|
|
896
894
|
return raw.post(path, {"duration": duration}, client=client)
|
|
897
895
|
|
|
@@ -918,11 +916,7 @@ def add_time_spent(
|
|
|
918
916
|
"""
|
|
919
917
|
task = normalize_model_parameter(task)
|
|
920
918
|
person = normalize_model_parameter(person)
|
|
921
|
-
path = "actions/tasks
|
|
922
|
-
task["id"],
|
|
923
|
-
date,
|
|
924
|
-
person["id"],
|
|
925
|
-
)
|
|
919
|
+
path = f"actions/tasks/{task['id']}/time-spents/{date}/persons/{person['id']}/add"
|
|
926
920
|
return raw.post(path, {"duration": duration}, client=client)
|
|
927
921
|
|
|
928
922
|
|
|
@@ -973,13 +967,13 @@ def add_comment(
|
|
|
973
967
|
|
|
974
968
|
if len(attachments) == 0:
|
|
975
969
|
return raw.post(
|
|
976
|
-
"actions/tasks
|
|
970
|
+
f"actions/tasks/{task['id']}/comment", data, client=client
|
|
977
971
|
)
|
|
978
972
|
else:
|
|
979
973
|
attachment = attachments.pop()
|
|
980
974
|
data["checklist"] = json.dumps(checklist)
|
|
981
975
|
return raw.upload(
|
|
982
|
-
"actions/tasks
|
|
976
|
+
f"actions/tasks/{task['id']}/comment",
|
|
983
977
|
attachment,
|
|
984
978
|
data=data,
|
|
985
979
|
extra_files=attachments,
|
|
@@ -1012,8 +1006,7 @@ def add_attachment_files_to_comment(
|
|
|
1012
1006
|
comment = normalize_model_parameter(comment)
|
|
1013
1007
|
attachment = attachments.pop()
|
|
1014
1008
|
return raw.upload(
|
|
1015
|
-
"actions/tasks
|
|
1016
|
-
% (task["id"], comment["id"]),
|
|
1009
|
+
f"actions/tasks/{task['id']}/comments/{comment['id']}/add-attachment",
|
|
1017
1010
|
attachment,
|
|
1018
1011
|
extra_files=attachments,
|
|
1019
1012
|
client=client,
|
|
@@ -1042,7 +1035,7 @@ def remove_comment(comment: str | dict, client: KitsuClient = default) -> str:
|
|
|
1042
1035
|
comment (str / dict): The comment dict or the comment ID.
|
|
1043
1036
|
"""
|
|
1044
1037
|
comment = normalize_model_parameter(comment)
|
|
1045
|
-
return raw.delete("data/comments
|
|
1038
|
+
return raw.delete(f"data/comments/{comment['id']}", client=client)
|
|
1046
1039
|
|
|
1047
1040
|
|
|
1048
1041
|
def create_preview(
|
|
@@ -1064,10 +1057,7 @@ def create_preview(
|
|
|
1064
1057
|
"""
|
|
1065
1058
|
task = normalize_model_parameter(task)
|
|
1066
1059
|
comment = normalize_model_parameter(comment)
|
|
1067
|
-
path = "actions/tasks
|
|
1068
|
-
task["id"],
|
|
1069
|
-
comment["id"],
|
|
1070
|
-
)
|
|
1060
|
+
path = f"actions/tasks/{task['id']}/comments/{comment['id']}/add-preview"
|
|
1071
1061
|
data = {}
|
|
1072
1062
|
if revision is not None:
|
|
1073
1063
|
data["revision"] = revision
|
|
@@ -1087,10 +1077,7 @@ def upload_preview_file(
|
|
|
1087
1077
|
preview_file (str / dict): The preview_file dict or the preview_file ID.
|
|
1088
1078
|
file_path (str): Path of the file to upload as preview.
|
|
1089
1079
|
"""
|
|
1090
|
-
path = (
|
|
1091
|
-
"pictures/preview-files/%s"
|
|
1092
|
-
% normalize_model_parameter(preview_file)["id"]
|
|
1093
|
-
)
|
|
1080
|
+
path = f"pictures/preview-files/{normalize_model_parameter(preview_file)['id']}"
|
|
1094
1081
|
if not normalize_movie:
|
|
1095
1082
|
path += "?normalize=false"
|
|
1096
1083
|
return raw.upload(path, file_path, client=client)
|
|
@@ -1227,14 +1214,14 @@ def batch_comments(
|
|
|
1227
1214
|
for x, comment in enumerate(comments):
|
|
1228
1215
|
if comment.get("attachment_files"):
|
|
1229
1216
|
for y, file_path in enumerate(comment["attachment_files"]):
|
|
1230
|
-
files["attachment_file
|
|
1217
|
+
files[f"attachment_file-{x}-{y}"] = open(file_path, "rb")
|
|
1231
1218
|
if comment.get("preview_files"):
|
|
1232
1219
|
for y, file_path in enumerate(comment["preview_files"]):
|
|
1233
|
-
files["preview_file
|
|
1220
|
+
files[f"preview_file-{x}-{y}"] = open(file_path, "rb")
|
|
1234
1221
|
|
|
1235
1222
|
files["comments"] = (None, json.dumps(comments), "application/json")
|
|
1236
1223
|
return raw.upload(
|
|
1237
|
-
"actions/tasks
|
|
1224
|
+
f"actions/tasks/{task['id'] + '/' if task else ''}batch-comment",
|
|
1238
1225
|
file_path=None,
|
|
1239
1226
|
files=files,
|
|
1240
1227
|
client=client,
|
|
@@ -1266,14 +1253,14 @@ def create_multiple_comments(
|
|
|
1266
1253
|
for x, comment in enumerate(comments):
|
|
1267
1254
|
if comment.get("attachment_files"):
|
|
1268
1255
|
for y, file_path in enumerate(comment["attachment_files"]):
|
|
1269
|
-
files["attachment_file
|
|
1256
|
+
files[f"attachment_file-{x}-{y}"] = open(file_path, "rb")
|
|
1270
1257
|
if comment.get("preview_files"):
|
|
1271
1258
|
for y, file_path in enumerate(comment["preview_files"]):
|
|
1272
|
-
files["preview_file
|
|
1259
|
+
files[f"preview_file-{x}-{y}"] = open(file_path, "rb")
|
|
1273
1260
|
|
|
1274
1261
|
files["comments"] = (None, json.dumps(comments), "application/json")
|
|
1275
1262
|
return raw.upload(
|
|
1276
|
-
"actions/projects
|
|
1263
|
+
f"actions/projects/{project['id']}/tasks/comment-many",
|
|
1277
1264
|
file_path=None,
|
|
1278
1265
|
files=files,
|
|
1279
1266
|
client=client,
|
|
@@ -1321,7 +1308,7 @@ def set_main_preview(
|
|
|
1321
1308
|
if frame_number is not None:
|
|
1322
1309
|
data["frame_number"] = frame_number
|
|
1323
1310
|
preview_file = normalize_model_parameter(preview_file)
|
|
1324
|
-
path = "actions/preview-files
|
|
1311
|
+
path = f"actions/preview-files/{preview_file['id']}/set-main-preview"
|
|
1325
1312
|
return raw.put(path, data, client=client)
|
|
1326
1313
|
|
|
1327
1314
|
|
|
@@ -1337,7 +1324,7 @@ def all_comments_for_task(
|
|
|
1337
1324
|
Comments linked to the given task.
|
|
1338
1325
|
"""
|
|
1339
1326
|
task = normalize_model_parameter(task)
|
|
1340
|
-
return raw.fetch_all("tasks
|
|
1327
|
+
return raw.fetch_all(f"tasks/{task['id']}/comments", client=client)
|
|
1341
1328
|
|
|
1342
1329
|
|
|
1343
1330
|
@cache
|
|
@@ -1352,7 +1339,7 @@ def get_last_comment_for_task(
|
|
|
1352
1339
|
Last comment posted for given task.
|
|
1353
1340
|
"""
|
|
1354
1341
|
task = normalize_model_parameter(task)
|
|
1355
|
-
return raw.fetch_first("tasks
|
|
1342
|
+
return raw.fetch_first(f"tasks/{task['id']}/comments", client=client)
|
|
1356
1343
|
|
|
1357
1344
|
|
|
1358
1345
|
@cache
|
|
@@ -1370,7 +1357,7 @@ def assign_task(
|
|
|
1370
1357
|
"""
|
|
1371
1358
|
person = normalize_model_parameter(person)
|
|
1372
1359
|
task = normalize_model_parameter(task)
|
|
1373
|
-
path = "/actions/persons
|
|
1360
|
+
path = f"/actions/persons/{person['id']}/assign"
|
|
1374
1361
|
return raw.put(path, {"task_ids": task["id"]}, client=client)
|
|
1375
1362
|
|
|
1376
1363
|
|
|
@@ -1425,7 +1412,7 @@ def new_task_type(
|
|
|
1425
1412
|
Returns:
|
|
1426
1413
|
dict: The created task type
|
|
1427
1414
|
"""
|
|
1428
|
-
task_type = get_task_type_by_name(name, for_entity)
|
|
1415
|
+
task_type = get_task_type_by_name(name, for_entity, client=client)
|
|
1429
1416
|
if task_type is None:
|
|
1430
1417
|
data = {"name": name, "color": color, "for_entity": for_entity}
|
|
1431
1418
|
task_type = raw.post("data/task-types", data, client=client)
|
|
@@ -1469,7 +1456,7 @@ def update_task(task: dict, client: KitsuClient = default) -> dict:
|
|
|
1469
1456
|
task["assignees"] = normalize_list_of_models_for_links(
|
|
1470
1457
|
task["assignees"]
|
|
1471
1458
|
)
|
|
1472
|
-
return raw.put("data/tasks
|
|
1459
|
+
return raw.put(f"data/tasks/{task['id']}", task, client=client)
|
|
1473
1460
|
|
|
1474
1461
|
|
|
1475
1462
|
def update_task_data(
|
|
@@ -1507,12 +1494,8 @@ def get_task_url(task: dict, client: KitsuClient = default) -> str:
|
|
|
1507
1494
|
"""
|
|
1508
1495
|
if not isinstance(task, dict):
|
|
1509
1496
|
raise TaskMustBeADictException
|
|
1510
|
-
|
|
1511
|
-
return
|
|
1512
|
-
host=raw.get_api_url_from_host(client=client),
|
|
1513
|
-
project_id=task["project_id"],
|
|
1514
|
-
task_id=task["id"],
|
|
1515
|
-
)
|
|
1497
|
+
host = raw.get_api_url_from_host(client=client)
|
|
1498
|
+
return f"{host}/productions/{task['project_id']}/shots/tasks/{task['id']}/"
|
|
1516
1499
|
|
|
1517
1500
|
|
|
1518
1501
|
def all_tasks_for_project(
|
|
@@ -1531,7 +1514,7 @@ def all_tasks_for_project(
|
|
|
1531
1514
|
list[dict]: Tasks related to given project.
|
|
1532
1515
|
"""
|
|
1533
1516
|
project = normalize_model_parameter(project)
|
|
1534
|
-
path = "/data/projects
|
|
1517
|
+
path = f"/data/projects/{project['id']}/tasks"
|
|
1535
1518
|
params = {}
|
|
1536
1519
|
if task_type is not None:
|
|
1537
1520
|
task_type = normalize_model_parameter(task_type)
|
|
@@ -1553,7 +1536,7 @@ def update_comment(comment: dict, client: KitsuClient = default) -> dict:
|
|
|
1553
1536
|
Returns:
|
|
1554
1537
|
dict: Updated comment.
|
|
1555
1538
|
"""
|
|
1556
|
-
return raw.put("data/comments
|
|
1539
|
+
return raw.put(f"data/comments/{comment['id']}", comment, client=client)
|
|
1557
1540
|
|
|
1558
1541
|
|
|
1559
1542
|
@cache
|
|
@@ -1592,7 +1575,7 @@ def all_previews_for_task(
|
|
|
1592
1575
|
list: Previews for the task.
|
|
1593
1576
|
"""
|
|
1594
1577
|
task = normalize_model_parameter(task)
|
|
1595
|
-
return raw.fetch_all("tasks
|
|
1578
|
+
return raw.fetch_all(f"tasks/{task['id']}/previews", client=client)
|
|
1596
1579
|
|
|
1597
1580
|
|
|
1598
1581
|
@cache
|
|
@@ -1609,7 +1592,7 @@ def all_open_tasks_for_person(
|
|
|
1609
1592
|
list: Open tasks for the person.
|
|
1610
1593
|
"""
|
|
1611
1594
|
person = normalize_model_parameter(person)
|
|
1612
|
-
return raw.fetch_all("persons
|
|
1595
|
+
return raw.fetch_all(f"persons/{person['id']}/tasks/open", client=client)
|
|
1613
1596
|
|
|
1614
1597
|
|
|
1615
1598
|
@cache
|
|
@@ -1629,7 +1612,7 @@ def all_tasks_for_person_and_type(
|
|
|
1629
1612
|
person = normalize_model_parameter(person)
|
|
1630
1613
|
task_type = normalize_model_parameter(task_type)
|
|
1631
1614
|
return raw.fetch_all(
|
|
1632
|
-
"persons
|
|
1615
|
+
f"persons/{person['id']}/task-types/{task_type['id']}/tasks",
|
|
1633
1616
|
client=client,
|
|
1634
1617
|
)
|
|
1635
1618
|
|
|
@@ -1648,7 +1631,7 @@ def all_comments_for_project(
|
|
|
1648
1631
|
list: Comments for the project.
|
|
1649
1632
|
"""
|
|
1650
1633
|
project = normalize_model_parameter(project)
|
|
1651
|
-
return raw.fetch_all("projects
|
|
1634
|
+
return raw.fetch_all(f"projects/{project['id']}/comments", client=client)
|
|
1652
1635
|
|
|
1653
1636
|
|
|
1654
1637
|
@cache
|
|
@@ -1666,7 +1649,7 @@ def all_notifications_for_project(
|
|
|
1666
1649
|
"""
|
|
1667
1650
|
project = normalize_model_parameter(project)
|
|
1668
1651
|
return raw.fetch_all(
|
|
1669
|
-
"projects
|
|
1652
|
+
f"projects/{project['id']}/notifications", client=client
|
|
1670
1653
|
)
|
|
1671
1654
|
|
|
1672
1655
|
|
|
@@ -1685,7 +1668,7 @@ def all_preview_files_for_project(
|
|
|
1685
1668
|
"""
|
|
1686
1669
|
project = normalize_model_parameter(project)
|
|
1687
1670
|
return raw.fetch_all(
|
|
1688
|
-
"projects
|
|
1671
|
+
f"projects/{project['id']}/preview-files", client=client
|
|
1689
1672
|
)
|
|
1690
1673
|
|
|
1691
1674
|
|
|
@@ -1704,7 +1687,7 @@ def all_subscriptions_for_project(
|
|
|
1704
1687
|
"""
|
|
1705
1688
|
project = normalize_model_parameter(project)
|
|
1706
1689
|
return raw.fetch_all(
|
|
1707
|
-
"projects
|
|
1690
|
+
f"projects/{project['id']}/subscriptions", client=client
|
|
1708
1691
|
)
|
|
1709
1692
|
|
|
1710
1693
|
|
|
@@ -1723,7 +1706,7 @@ def get_persons_tasks_dates(
|
|
|
1723
1706
|
"""
|
|
1724
1707
|
project = normalize_model_parameter(project)
|
|
1725
1708
|
return raw.get(
|
|
1726
|
-
"data/projects
|
|
1709
|
+
f"data/projects/{project['id']}/persons/tasks/dates", client=client
|
|
1727
1710
|
)
|
|
1728
1711
|
|
|
1729
1712
|
|
|
@@ -1740,8 +1723,7 @@ def remove_tasks_for_type(
|
|
|
1740
1723
|
project = normalize_model_parameter(project)
|
|
1741
1724
|
task_type = normalize_model_parameter(task_type)
|
|
1742
1725
|
return raw.delete(
|
|
1743
|
-
"data/projects
|
|
1744
|
-
% (project["id"], task_type["id"]),
|
|
1726
|
+
f"data/projects/{project['id']}/task-types/{task_type['id']}/tasks",
|
|
1745
1727
|
client=client,
|
|
1746
1728
|
)
|
|
1747
1729
|
|
|
@@ -1802,7 +1784,7 @@ def get_task_time_spent_for_date(
|
|
|
1802
1784
|
"""
|
|
1803
1785
|
task = normalize_model_parameter(task)
|
|
1804
1786
|
return raw.get(
|
|
1805
|
-
"data/tasks
|
|
1787
|
+
f"data/tasks/{task['id']}/time-spent/for-date",
|
|
1806
1788
|
params={"date": date},
|
|
1807
1789
|
client=client,
|
|
1808
1790
|
)
|
|
@@ -1821,7 +1803,7 @@ def remove_time_spent(
|
|
|
1821
1803
|
Response: Request response object.
|
|
1822
1804
|
"""
|
|
1823
1805
|
time_spent = normalize_model_parameter(time_spent)
|
|
1824
|
-
return raw.delete("data/time-spents
|
|
1806
|
+
return raw.delete(f"data/time-spents/{time_spent['id']}", client=client)
|
|
1825
1807
|
|
|
1826
1808
|
|
|
1827
1809
|
def add_preview_to_comment(
|
|
@@ -1842,7 +1824,7 @@ def add_preview_to_comment(
|
|
|
1842
1824
|
comment = normalize_model_parameter(comment)
|
|
1843
1825
|
preview_file = normalize_model_parameter(preview_file)
|
|
1844
1826
|
return raw.post(
|
|
1845
|
-
"data/comments
|
|
1827
|
+
f"data/comments/{comment['id']}/preview-files",
|
|
1846
1828
|
{"preview_file_id": preview_file["id"]},
|
|
1847
1829
|
client=client,
|
|
1848
1830
|
)
|
|
@@ -1863,8 +1845,7 @@ def remove_preview_from_comment(
|
|
|
1863
1845
|
comment = normalize_model_parameter(comment)
|
|
1864
1846
|
preview_file = normalize_model_parameter(preview_file)
|
|
1865
1847
|
return raw.delete(
|
|
1866
|
-
"data/comments
|
|
1867
|
-
% (comment["id"], preview_file["id"]),
|
|
1848
|
+
f"data/comments/{comment['id']}/preview-files/{preview_file['id']}",
|
|
1868
1849
|
client=client,
|
|
1869
1850
|
)
|
|
1870
1851
|
|
|
@@ -1887,7 +1868,7 @@ def acknowledge_comment(
|
|
|
1887
1868
|
task = normalize_model_parameter(task)
|
|
1888
1869
|
comment = normalize_model_parameter(comment)
|
|
1889
1870
|
return raw.post(
|
|
1890
|
-
"data/tasks
|
|
1871
|
+
f"data/tasks/{task['id']}/comments/{comment['id']}/ack",
|
|
1891
1872
|
{},
|
|
1892
1873
|
client=client,
|
|
1893
1874
|
)
|
|
@@ -1916,7 +1897,7 @@ def reply_to_comment(
|
|
|
1916
1897
|
person = normalize_model_parameter(person)
|
|
1917
1898
|
data["person_id"] = person["id"]
|
|
1918
1899
|
return raw.post(
|
|
1919
|
-
"data/comments
|
|
1900
|
+
f"data/comments/{comment['id']}/replies",
|
|
1920
1901
|
data,
|
|
1921
1902
|
client=client,
|
|
1922
1903
|
)
|
|
@@ -1940,8 +1921,7 @@ def delete_comment_attachment(
|
|
|
1940
1921
|
comment = normalize_model_parameter(comment)
|
|
1941
1922
|
attachment_file = normalize_model_parameter(attachment_file)
|
|
1942
1923
|
return raw.delete(
|
|
1943
|
-
"data/comments
|
|
1944
|
-
% (comment["id"], attachment_file["id"]),
|
|
1924
|
+
f"data/comments/{comment['id']}/attachment-files/{attachment_file['id']}",
|
|
1945
1925
|
client=client,
|
|
1946
1926
|
)
|
|
1947
1927
|
|
|
@@ -1964,7 +1944,7 @@ def delete_comment_reply(
|
|
|
1964
1944
|
comment = normalize_model_parameter(comment)
|
|
1965
1945
|
reply = normalize_model_parameter(reply)
|
|
1966
1946
|
return raw.delete(
|
|
1967
|
-
"data/comments
|
|
1947
|
+
f"data/comments/{comment['id']}/replies/{reply['id']}",
|
|
1968
1948
|
client=client,
|
|
1969
1949
|
)
|
|
1970
1950
|
|
|
@@ -1989,7 +1969,7 @@ def create_shot_tasks(
|
|
|
1989
1969
|
normalize_model_parameter(task_type)["id"] for task_type in task_types
|
|
1990
1970
|
]
|
|
1991
1971
|
return raw.post(
|
|
1992
|
-
"data/shots
|
|
1972
|
+
f"data/shots/{shot['id']}/tasks",
|
|
1993
1973
|
{"task_type_ids": task_type_ids},
|
|
1994
1974
|
client=client,
|
|
1995
1975
|
)
|
|
@@ -2015,7 +1995,7 @@ def create_asset_tasks(
|
|
|
2015
1995
|
normalize_model_parameter(task_type)["id"] for task_type in task_types
|
|
2016
1996
|
]
|
|
2017
1997
|
return raw.post(
|
|
2018
|
-
"data/assets
|
|
1998
|
+
f"data/assets/{asset['id']}/tasks",
|
|
2019
1999
|
{"task_type_ids": task_type_ids},
|
|
2020
2000
|
client=client,
|
|
2021
2001
|
)
|
|
@@ -2041,7 +2021,7 @@ def create_edit_tasks(
|
|
|
2041
2021
|
normalize_model_parameter(task_type)["id"] for task_type in task_types
|
|
2042
2022
|
]
|
|
2043
2023
|
return raw.post(
|
|
2044
|
-
"data/edits
|
|
2024
|
+
f"data/edits/{edit['id']}/tasks",
|
|
2045
2025
|
{"task_type_ids": task_type_ids},
|
|
2046
2026
|
client=client,
|
|
2047
2027
|
)
|
|
@@ -2067,7 +2047,7 @@ def create_concept_tasks(
|
|
|
2067
2047
|
normalize_model_parameter(task_type)["id"] for task_type in task_types
|
|
2068
2048
|
]
|
|
2069
2049
|
return raw.post(
|
|
2070
|
-
"data/concepts
|
|
2050
|
+
f"data/concepts/{concept['id']}/tasks",
|
|
2071
2051
|
{"task_type_ids": task_type_ids},
|
|
2072
2052
|
client=client,
|
|
2073
2053
|
)
|
|
@@ -2093,7 +2073,7 @@ def create_entity_tasks(
|
|
|
2093
2073
|
normalize_model_parameter(task_type)["id"] for task_type in task_types
|
|
2094
2074
|
]
|
|
2095
2075
|
return raw.post(
|
|
2096
|
-
"data/entities
|
|
2076
|
+
f"data/entities/{entity['id']}/tasks",
|
|
2097
2077
|
{"task_type_ids": task_type_ids},
|
|
2098
2078
|
client=client,
|
|
2099
2079
|
)
|