zou 0.20.50__py3-none-any.whl → 0.20.51__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.
zou/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.20.50"
1
+ __version__ = "0.20.51"
@@ -46,56 +46,60 @@ class TaskTypeEstimationsCsvImportResource(BaseCsvProjectImportResource):
46
46
  400:
47
47
  description: Format error
48
48
  """
49
- return super().post(project_id, task_type_id, episode_id)
49
+ task_type = tasks_service.get_task_type(task_type_id)
50
+ return super().post(project_id, task_type, episode_id)
50
51
 
51
- def prepare_import(self, project_id, task_type_id, episode_id=None):
52
+ def prepare_import(self, project_id, task_type, episode_id=None):
52
53
  self.organisation = persons_service.get_organisation()
53
54
  self.assets_map = {}
54
55
  self.shots_map = {}
55
56
  self.tasks_map = {}
56
57
 
57
- asset_types_map = {}
58
- asset_types = assets_service.get_asset_types_for_project(project_id)
59
- for asset_type in asset_types:
60
- asset_types_map[asset_type["id"]] = slugify(asset_type["name"])
61
-
62
- criterions_assets = {"project_id": project_id}
63
- if episode_id is not None and episode_id not in ["main", "all"]:
64
- criterions_assets["source_id"] = episode_id
65
- assets = assets_service.get_assets(criterions_assets)
66
- for asset in assets:
67
- key = "%s%s" % (
68
- asset_types_map[asset["entity_type_id"]],
69
- slugify(asset["name"]),
58
+ if task_type["for_entity"] == "Asset":
59
+ asset_types_map = {}
60
+ asset_types = assets_service.get_asset_types_for_project(
61
+ project_id
70
62
  )
71
- self.assets_map[key] = asset["id"]
72
-
73
- sequences_map = {}
74
- criterions_sequences = {"project_id": project_id}
75
- if episode_id is not None and episode_id not in ["main", "all"]:
76
- criterions_sequences["parent_id"] = episode_id
77
- sequences = shots_service.get_sequences(criterions_sequences)
78
- for sequence in sequences:
79
- sequences_map[sequence["id"]] = slugify(sequence["name"])
80
-
81
- shots = shots_service.get_shots({"project_id": project_id})
82
- for shot in shots:
83
- sequence_key = sequences_map.get(shot["parent_id"])
84
- if sequence_key is not None:
85
- key = "%s%s" % (sequence_key, slugify(shot["name"]))
86
- self.shots_map[key] = shot["id"]
63
+ for asset_type in asset_types:
64
+ asset_types_map[asset_type["id"]] = slugify(asset_type["name"])
65
+
66
+ criterions_assets = {"project_id": project_id}
67
+ if episode_id is not None and episode_id not in ["main", "all"]:
68
+ criterions_assets["source_id"] = episode_id
69
+ assets = assets_service.get_assets(criterions_assets)
70
+ for asset in assets:
71
+ key = "%s%s" % (
72
+ asset_types_map[asset["entity_type_id"]],
73
+ slugify(asset["name"]),
74
+ )
75
+ self.assets_map[key] = asset["id"]
76
+ elif task_type["for_entity"] == "Shot":
77
+ sequences_map = {}
78
+ criterions_sequences = {"project_id": project_id}
79
+ if episode_id is not None and episode_id not in ["main", "all"]:
80
+ criterions_sequences["parent_id"] = episode_id
81
+ sequences = shots_service.get_sequences(criterions_sequences)
82
+ for sequence in sequences:
83
+ sequences_map[sequence["id"]] = slugify(sequence["name"])
84
+
85
+ shots = shots_service.get_shots({"project_id": project_id})
86
+ for shot in shots:
87
+ sequence_key = sequences_map.get(shot["parent_id"])
88
+ if sequence_key is not None:
89
+ key = "%s%s" % (sequence_key, slugify(shot["name"]))
90
+ self.shots_map[key] = shot["id"]
87
91
 
88
92
  for task in tasks_service.get_tasks_for_project_and_task_type(
89
- project_id, task_type_id
93
+ project_id, task_type["id"]
90
94
  ):
91
95
  self.tasks_map[task["entity_id"]] = task["id"]
92
96
 
93
- def import_row(self, row, project_id, task_type_id, episode_id=None):
97
+ def import_row(self, row, project_id, task_type, episode_id=None):
94
98
  key = slugify("%s%s" % (row["Parent"], row["Entity"]))
95
99
 
96
- if self.assets_map.get(key):
100
+ if task_type["for_entity"] == "Asset" and self.assets_map.get(key):
97
101
  entity_id = self.assets_map[key]
98
- elif self.shots_map.get(key):
102
+ elif task_type["for_entity"] == "Shot" and self.shots_map.get(key):
99
103
  entity_id = self.shots_map[key]
100
104
  else:
101
105
  raise RowException(f"Entity {key} not found")
@@ -149,7 +149,11 @@ def get_for_entity_from_task(task):
149
149
  entity_type = get_entity_type(entity["entity_type_id"])
150
150
  for_entity = entity_type["name"]
151
151
  if for_entity.lower() not in [
152
- "shot", "sequence", "episode", "edit", "concept"
152
+ "shot",
153
+ "sequence",
154
+ "episode",
155
+ "edit",
156
+ "concept",
153
157
  ]:
154
158
  for_entity = "Asset"
155
159
  return for_entity
@@ -887,7 +887,7 @@ def generate_playlisted_entity_from_task(task_id, task_type_links):
887
887
  ]
888
888
  if len(available_task_types) > 0:
889
889
  task_type_id = available_task_types[0]
890
- preview_file = preview_files[ task_type_id][0]
890
+ preview_file = preview_files[task_type_id][0]
891
891
 
892
892
  if preview_file is not None:
893
893
  playlisted_entity.update(
@@ -705,8 +705,7 @@ def get_task_type_links(project_id, for_entity="Asset"):
705
705
  Return a lisk of links for given project and entity type.
706
706
  """
707
707
  task_type_links = (
708
- ProjectTaskTypeLink.query
709
- .join(TaskType)
708
+ ProjectTaskTypeLink.query.join(TaskType)
710
709
  .filter(ProjectTaskTypeLink.project_id == project_id)
711
710
  .filter(TaskType.for_entity == for_entity)
712
711
  .order_by(ProjectTaskTypeLink.priority.desc())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 0.20.50
3
+ Version: 0.20.51
4
4
  Summary: API to store and manage the data of your animation production
5
5
  Home-page: https://zou.cg-wire.com
6
6
  Author: CG Wire
@@ -1,4 +1,4 @@
1
- zou/__init__.py,sha256=j9fVrpQ67n0_aPzEmSWoe1Lq3AYE5iGwQdtuvN8qakI,24
1
+ zou/__init__.py,sha256=jKuoU0n-XXsegDJBRz_IGknA1tJmBjiSh3HA8TFJDGg,24
2
2
  zou/cli.py,sha256=W7nhMII-gyl8AlL6zgDmverSdFphDV_WnuN3BHrHc8w,22448
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
4
  zou/event_stream.py,sha256=yTU1Z3r55SiYm8Y5twtJIo5kTnhbBK-XKc8apdgvzNw,8291
@@ -112,7 +112,7 @@ zou/app/blueprints/source/csv/casting.py,sha256=zUlwEnSheoCMTIgvRlKJgNv3hYPDjfSr
112
112
  zou/app/blueprints/source/csv/edits.py,sha256=yL1RcClBxPNakLt326M2aJk6pVv0H7CrNXALuKHkDZ8,8386
113
113
  zou/app/blueprints/source/csv/persons.py,sha256=QciJ47B3rAPyUQTAeToCUAhEai16J4s37oOErjdC_Vw,2582
114
114
  zou/app/blueprints/source/csv/shots.py,sha256=5OI0IBY8C72aBbDFrIkvN-ZkWWCHsvOGUQ0Z9rWsnDs,9748
115
- zou/app/blueprints/source/csv/task_type_estimations.py,sha256=FBD0dWh635yjEPXWQlidc3XunWhw29qhObTPpmpA5qA,5840
115
+ zou/app/blueprints/source/csv/task_type_estimations.py,sha256=L4urkpixLQv3wqpZKgJl8QcNz30D1ZW6OAr-pytnau8,6205
116
116
  zou/app/blueprints/source/shotgun/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
117
  zou/app/blueprints/source/shotgun/assets.py,sha256=vuRvy0oUszImYRawrbWC2h7CHYSBvGXDJPoa6ZqpG_U,4980
118
118
  zou/app/blueprints/source/shotgun/base.py,sha256=Y0sX8X3oN0AQWiBqjLX-cijnBZH8UzZp4iC8BQpf_tk,6193
@@ -200,7 +200,7 @@ zou/app/services/custom_actions_service.py,sha256=fWISEOOdthadrxeHuacEel5Xj6msn0
200
200
  zou/app/services/deletion_service.py,sha256=jZzNzyfmKJK1Sro9PUV0v9cVh6QQ2qh-0bQ4Ajuk77I,17434
201
201
  zou/app/services/edits_service.py,sha256=P3-eBoHSikYjtuHeulTv_WuILEe502sU4qFObfokcQY,12114
202
202
  zou/app/services/emails_service.py,sha256=i9EP3zw02ZteVt9OZTvkfaoU19_T4kLhRmrhIvYw2SQ,11965
203
- zou/app/services/entities_service.py,sha256=SbLET7DmyrGzUe-R5T3sEWHW61jDtckHXINj3BgEJy8,17340
203
+ zou/app/services/entities_service.py,sha256=tiKZpv28PMJqTT0S4W6T_4E_gOGytps2QhENB5IvOwQ,17373
204
204
  zou/app/services/events_service.py,sha256=Ew-bY5hqrWLmpbVj1_xd3E2S3JtyAGzdgw2XjudTZjc,2700
205
205
  zou/app/services/exception.py,sha256=miD3RCXUgGezLvm2hqZfNqGEdodybu1TTLifPKgb5-E,4349
206
206
  zou/app/services/file_tree_service.py,sha256=8JNBDgnXtV-AmSJ3gnUGB4oSwLjPgi1WYyL0Kc98JRE,33875
@@ -210,10 +210,10 @@ zou/app/services/names_service.py,sha256=TOSrintROmxcAlcFQE0i2E3PBLnw81GAztNselp
210
210
  zou/app/services/news_service.py,sha256=eOXkvLhOcgncI2NrgiJEccV28oxZX5CsZVqaE-l4kWQ,9084
211
211
  zou/app/services/notifications_service.py,sha256=7GDRio_mGaRYV5BHOAdpxBZjA_LLYUfVpbwZqy1n9pI,15685
212
212
  zou/app/services/persons_service.py,sha256=HjV-su80Y2BO9l5zoBKHMNF0mDGtkWqPhEOs3nQ3nlI,16566
213
- zou/app/services/playlists_service.py,sha256=Z0EDxKCH9Widi3-Bx8svpQaRtreXKizzrL9wZq-YXjs,33182
213
+ zou/app/services/playlists_service.py,sha256=IKjvT3RZigwXsrhsRFqaWWlm-tZSN6-jgMDf0Hn3w3Q,33179
214
214
  zou/app/services/plugins_service.py,sha256=dbU-2f7t3eo6VISQBsASM8Or4Y8ha6Vt8ZHgtizdOi0,1917
215
215
  zou/app/services/preview_files_service.py,sha256=673xVNvyK2LoMqWZ6b-g6n1krXOPFVFUh2wonDNLyck,36030
216
- zou/app/services/projects_service.py,sha256=ayJBDbw9kuxuU5a2SQVnVquB3Ja0f0VPsG_AqpK27dc,21849
216
+ zou/app/services/projects_service.py,sha256=TF9WcGLxQUzZkVIp3q4p8uALn2i0JEutvFtkJ0HvMt0,21840
217
217
  zou/app/services/scenes_service.py,sha256=iXN19HU4njPF5VtZXuUrVJ-W23ZQuQNPC3ADXltbWtU,992
218
218
  zou/app/services/schedule_service.py,sha256=E99HKYsXgnK2sw58fw-NNHXWBgVJiA60upztjkNSCaM,6989
219
219
  zou/app/services/shots_service.py,sha256=MfBvw0hhVwi_KSQVnM-V4O3LnNkJB2imJWF6n9J6xfc,54747
@@ -446,9 +446,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
446
446
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
447
447
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
448
448
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
449
- zou-0.20.50.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
450
- zou-0.20.50.dist-info/METADATA,sha256=KKo_aN4MZvc9psbD4mzukGDh3sAVReibA_TojI4ciOQ,6698
451
- zou-0.20.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
452
- zou-0.20.50.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
453
- zou-0.20.50.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
454
- zou-0.20.50.dist-info/RECORD,,
449
+ zou-0.20.51.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
450
+ zou-0.20.51.dist-info/METADATA,sha256=2-YCRFAvnrZKvyN8gJiTnGublubTooVWfmLl4A6dyOQ,6698
451
+ zou-0.20.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
452
+ zou-0.20.51.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
453
+ zou-0.20.51.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
454
+ zou-0.20.51.dist-info/RECORD,,
File without changes