gazu 0.10.5__py2.py3-none-any.whl → 0.10.7__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.10.5"
1
+ __version__ = "0.10.7"
gazu/sync.py CHANGED
@@ -22,6 +22,7 @@ def get_last_events(
22
22
  after=None,
23
23
  before=None,
24
24
  only_files=False,
25
+ name=None,
25
26
  client=default,
26
27
  ):
27
28
  """
@@ -46,6 +47,8 @@ def get_last_events(
46
47
  params["after"] = validate_date_format(after)
47
48
  if before is not None:
48
49
  params["before"] = validate_date_format(before)
50
+ if name is not None:
51
+ params["name"] = name
49
52
  return raw.get(path, params=params, client=client)
50
53
 
51
54
 
@@ -88,7 +91,7 @@ def import_entity_links(links, client=default):
88
91
  return raw.post("import/kitsu/entity-links", links, client=client)
89
92
 
90
93
 
91
- def get_model_list_diff(source_list, target_list):
94
+ def get_model_list_diff(source_list, target_list, id_field="id"):
92
95
  """
93
96
  Args:
94
97
  source_list (list): List of models to compare.
@@ -99,13 +102,17 @@ def get_model_list_diff(source_list, target_list):
99
102
  and one containing the models that should not be in the target list.
100
103
  """
101
104
  missing = []
102
- source_ids = {m["id"]: True for m in source_list}
103
- target_ids = {m["id"]: True for m in target_list}
104
- for model in source_list:
105
- if model["id"] not in target_ids:
106
- missing.append(model)
105
+ source_ids = {m[id_field]: True for m in source_list}
106
+ target_ids = {m[id_field]: True for m in target_list}
107
+ missing = [
108
+ model
109
+ for model in source_list
110
+ if not target_ids.get(model[id_field], False)
111
+ ]
107
112
  unexpected = [
108
- model for model in target_list if model["id"] not in source_ids
113
+ model
114
+ for model in target_list
115
+ if not source_ids.get(model[id_field], False)
109
116
  ]
110
117
  return (missing, unexpected)
111
118
 
@@ -450,7 +457,6 @@ def push_tasks(
450
457
 
451
458
  default_status_id = normalize_model_parameter(default_status)["id"]
452
459
  task_type_map = get_sync_task_type_id_map(client_source, client_target)
453
- task_status_map = get_sync_task_status_id_map(client_source, client_target)
454
460
  person_map = get_sync_person_id_map(client_source, client_target)
455
461
 
456
462
  tasks = task_module.all_tasks_for_project(
@@ -528,7 +534,14 @@ def push_task_comments(
528
534
 
529
535
 
530
536
  def push_task_comment(
531
- task_status_map, person_map, task, comment, client_source, client_target
537
+ task_status_map,
538
+ person_map,
539
+ task,
540
+ comment,
541
+ client_source,
542
+ client_target,
543
+ author_id=None,
544
+ tmp_path="/tmp/zou/sync/",
532
545
  ):
533
546
  """
534
547
  Create a new comment into target api for each comment in source task
@@ -550,7 +563,7 @@ def push_task_comment(
550
563
  attachment_file = files_module.get_attachment_file(
551
564
  attachment_id, client=client_source
552
565
  )
553
- file_path = "/tmp/zou/sync/" + attachment_file["name"]
566
+ file_path = os.path.join(tmp_path, attachment_file["name"])
554
567
  files_module.download_attachment_file(
555
568
  attachment_file, file_path, client=client_source
556
569
  )
@@ -569,11 +582,11 @@ def push_task_comment(
569
582
  preview_file["original_name"] is not None
570
583
  and preview_file["extension"] is not None
571
584
  ):
572
- file_path = (
573
- "/tmp/zou/sync/"
574
- + preview_file["original_name"]
585
+ file_path = os.path.join(
586
+ tmp_path,
587
+ preview_file["original_name"]
575
588
  + "."
576
- + preview_file["extension"]
589
+ + preview_file["extension"],
577
590
  )
578
591
  files_module.download_preview_file(
579
592
  preview_file, file_path, client=client_source
@@ -586,7 +599,10 @@ def push_task_comment(
586
599
  )
587
600
 
588
601
  task_status = {"id": task_status_map[comment["task_status_id"]]}
589
- author_id = person_map[comment["person_id"]]
602
+ if author_id is not None:
603
+ author_id = author_id
604
+ else:
605
+ author_id = person_map[comment["person_id"]]
590
606
  person = {"id": author_id}
591
607
 
592
608
  comment_target = task_module.add_comment(
gazu/task.py CHANGED
@@ -789,6 +789,7 @@ def add_comment(
789
789
  checklist=[],
790
790
  attachments=[],
791
791
  created_at=None,
792
+ links=[],
792
793
  client=default,
793
794
  ):
794
795
  """
@@ -804,6 +805,7 @@ def add_comment(
804
805
  checklist (list): Comment checklist
805
806
  attachments (list[file_path]): Attachments file paths
806
807
  created_at (str): Comment date
808
+ links (list): List of links to add to the comment
807
809
 
808
810
  Returns:
809
811
  dict: Created comment.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gazu
3
- Version: 0.10.5
3
+ Version: 0.10.7
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
@@ -31,7 +31,7 @@ Requires-Dist: python-socketio[client] <6,>=5.11.0 ; python_version != "2.7"
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: wheel ; extra == 'dev'
33
33
  Provides-Extra: lint
34
- Requires-Dist: black ==24.4.0 ; (python_version >= "3.8") and extra == 'lint'
34
+ Requires-Dist: black ==24.4.2 ; (python_version >= "3.8") and extra == 'lint'
35
35
  Requires-Dist: pre-commit ==3.7.0 ; (python_version >= "3.9") and extra == 'lint'
36
36
  Provides-Extra: test
37
37
  Requires-Dist: pytest ; extra == 'test'
@@ -1,5 +1,5 @@
1
1
  gazu/__init__.py,sha256=cek7Vq4FrzBIzMvtAjlL-3af5TOVLWywYBSMQQWuYec,3056
2
- gazu/__version__.py,sha256=c61d5YjslqtpItkzB2NGlURm177H2racruHXV9G6u6s,23
2
+ gazu/__version__.py,sha256=0tXlefZZVkpPOSdzPCMF-P32mDAIZaCt77gWQCpBAjY,23
3
3
  gazu/asset.py,sha256=GWwam0yqHna_b9_5g5r0-O2zhMb7KlhfbIC17IOXKkY,14488
4
4
  gazu/cache.py,sha256=MnxrnfYN7wHNTTL7qzkEpYCYzWcolT56fqQ0_RegMbE,5879
5
5
  gazu/casting.py,sha256=5xmGMoU3MFgv1br8_5xyTx-Z7wo9r51wRisiblqcr94,3945
@@ -19,11 +19,11 @@ gazu/project.py,sha256=fssI_Bf5UqqRd9bfM68oyfkhjxwWvjdiAcYvvUhI5LY,12649
19
19
  gazu/scene.py,sha256=bYsy7zKdQfDTfeqNAlgaqGMs2Hhxdy40NGt6TX_FBdA,5307
20
20
  gazu/shot.py,sha256=bSfju-STx_HZO1K51bk2YrttIPxclnoGV07Kne7Bfl0,18525
21
21
  gazu/sorting.py,sha256=qSIO0pOHkj0Tl4gm9BJrYrcifWGGGmsW68Pl86zB_bg,266
22
- gazu/sync.py,sha256=gWxRKZvmLW7T1pyUbyTCVYOz0_7-bWDCA8LnMC-2w-g,21252
23
- gazu/task.py,sha256=CnfLZC0K4WitfrSOcY5qdR5fubXX-eIu6OQf_qLlkYE,35121
22
+ gazu/sync.py,sha256=xG6QbLDKJNSZEhtn3RHFk8ykDz-w2gnWM17Xgl6no_c,21466
23
+ gazu/task.py,sha256=4aO8Ggk4lagVaNkFIdFE0-HnCcWg6d38BTFuwlqbyRY,35193
24
24
  gazu/user.py,sha256=GyJf6mrynHvLllw3Hsiv-6wjaYTHO_PBNkJzyJjJA1A,9556
25
- gazu-0.10.5.dist-info/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
26
- gazu-0.10.5.dist-info/METADATA,sha256=XOG_I49KEmIVpdLox4uyshiPVLC0nBV9U_FiXMXHQCM,5181
27
- gazu-0.10.5.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
28
- gazu-0.10.5.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
29
- gazu-0.10.5.dist-info/RECORD,,
25
+ gazu-0.10.7.dist-info/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
26
+ gazu-0.10.7.dist-info/METADATA,sha256=gsDnv2oWFHCACgbMIrQCBz13UGc_IsWDXHxsF-G9SmI,5181
27
+ gazu-0.10.7.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
28
+ gazu-0.10.7.dist-info/top_level.txt,sha256=nv7fRIVpYYyIlk_66hBmMyvWcSC7UU-r-GE8uC1u1Go,5
29
+ gazu-0.10.7.dist-info/RECORD,,
File without changes
File without changes