zou 0.20.35__py3-none-any.whl → 0.20.37__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.35"
1
+ __version__ = "0.20.37"
@@ -524,37 +524,38 @@ def build_playlist_movie_file(playlist, job, shots, params, full, remote):
524
524
  movie_file_path = get_playlist_movie_file_path(job)
525
525
  tmp_file_paths = retrieve_playlist_tmp_files(previews)
526
526
 
527
- if not remote:
528
- success = False
529
- if not full:
530
- success = _run_concatenation(
531
- playlist,
532
- job,
533
- tmp_file_paths,
534
- movie_file_path,
535
- params,
536
- movie.concat_demuxer,
537
- )
538
-
539
- # Try again using concat filter
540
- if not success:
541
- success = _run_concatenation(
542
- playlist,
543
- job,
544
- tmp_file_paths,
545
- movie_file_path,
546
- params,
547
- movie.concat_filter,
548
- )
549
- else:
550
- try:
551
- _run_remote_job_build_playlist(
552
- app, job, previews, params, movie_file_path, full
553
- )
554
- success = True
555
- except Exception as exc:
556
- app.logger.error(exc)
527
+ if tmp_file_paths:
528
+ if not remote:
557
529
  success = False
530
+ if not full:
531
+ success = _run_concatenation(
532
+ playlist,
533
+ job,
534
+ tmp_file_paths,
535
+ movie_file_path,
536
+ params,
537
+ movie.concat_demuxer,
538
+ )
539
+
540
+ # Try again using concat filter
541
+ if not success:
542
+ success = _run_concatenation(
543
+ playlist,
544
+ job,
545
+ tmp_file_paths,
546
+ movie_file_path,
547
+ params,
548
+ movie.concat_filter,
549
+ )
550
+ else:
551
+ try:
552
+ _run_remote_job_build_playlist(
553
+ app, job, previews, params, movie_file_path, full
554
+ )
555
+ success = True
556
+ except Exception as exc:
557
+ app.logger.error(exc)
558
+ success = False
558
559
 
559
560
  except Exception as exc:
560
561
  app.logger.error(exc)
zou/event_stream.py CHANGED
@@ -8,7 +8,7 @@ from flask_jwt_extended import (
8
8
  jwt_required,
9
9
  verify_jwt_in_request,
10
10
  )
11
- from flask_socketio import SocketIO, disconnect, join_room, emit
11
+ from flask_socketio import SocketIO, disconnect, join_room, leave_room, emit
12
12
 
13
13
  from zou.app import config, app
14
14
  from zou.app.utils.redis import get_redis_url
@@ -25,6 +25,7 @@ socketio.init_app(app, message_queue=redis_url, async_mode="gevent")
25
25
 
26
26
  def _get_empty_room(current_frame=0):
27
27
  return {
28
+ "playlist_id": None,
28
29
  "user_id": None,
29
30
  "people": [],
30
31
  "is_playing": False,
@@ -60,10 +61,22 @@ def _leave_room(room_id, user_id):
60
61
  rooms_data[room_id] = room
61
62
  else:
62
63
  del rooms_data[room_id]
63
- emit("preview-room:room-people-updated", room, room=room_id)
64
+ _emit_people_updated(room_id, room["people"])
65
+ return room
66
+
67
+
68
+ def _emit_people_updated(room_id, people):
69
+ event_data = {
70
+ "people": people,
71
+ "playlist_id": room_id,
72
+ "id": room_id,
73
+ }
74
+ emit("preview-room:room-people-updated", event_data, room=room_id)
75
+ return event_data
64
76
 
65
77
 
66
78
  def _update_room_playing_status(data, room):
79
+ room["playlist_id"] = data.get("playlist_id", False)
67
80
  room["user_id"] = data.get("user_id", False)
68
81
  room["is_playing"] = data.get("is_playing", False)
69
82
  room["is_repeating"] = data.get("is_repeating", False)
@@ -110,10 +123,11 @@ def disconnected(_):
110
123
  try:
111
124
  verify_jwt_in_request()
112
125
  user_id = get_jwt_identity()
113
- # needed to be able to clear empty rooms
126
+ # Needed to be able to clear empty rooms
114
127
  tmp_rooms_data = dict(rooms_data)
115
128
  for room_id in tmp_rooms_data:
116
129
  _leave_room(room_id, user_id)
130
+ leave_room(room_id, user_id)
117
131
  server_stats["nb_connections"] -= 1
118
132
  app.logger.info("Websocket client disconnected")
119
133
  except Exception:
@@ -141,12 +155,27 @@ def on_open_playlist(data):
141
155
  when a person opens the playlist page he immediately enters the
142
156
  websocket room. This way he can see in live which people are in the
143
157
  review room. The user still has to explicitly enter the review room
144
- to actually be in sync with the other users
158
+ to actually be in sync with the other users.
145
159
  """
146
160
  room, room_id = _get_room_from_data(data)
147
161
  rooms_data[room_id] = room
162
+ # Connect to the socketio room but dont add the user to the data of
163
+ # the room.
148
164
  join_room(room_id)
149
- emit("preview-room:room-people-updated", room, room=room_id)
165
+ _emit_people_updated(room_id, room["people"])
166
+
167
+
168
+ @socketio.on("preview-room:close-playlist", namespace="/events")
169
+ @jwt_required()
170
+ def on_close_playlist(data):
171
+ """
172
+ when a person closes the playlist page he immediately leaves the
173
+ websocket room.
174
+ """
175
+ room, room_id = _get_room_from_data(data)
176
+ # Leave only the socketio room but dont remove the user from the data of
177
+ # the room. This operation must be done via a leave event.
178
+ leave_room(room_id)
150
179
 
151
180
 
152
181
  @socketio.on("preview-room:join", namespace="/events")
@@ -161,8 +190,9 @@ def on_join(data):
161
190
  if len(room["people"]) == 0:
162
191
  _update_room_playing_status(data, room)
163
192
  room["people"] = list(set(room["people"] + [user_id]))
193
+ room["playlist_id"] = room_id
164
194
  rooms_data[room_id] = room
165
- emit("preview-room:room-people-updated", room, room=room_id)
195
+ _emit_people_updated(room_id, room["people"])
166
196
 
167
197
 
168
198
  @socketio.on("preview-room:leave", namespace="/events")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zou
3
- Version: 0.20.35
3
+ Version: 0.20.37
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
@@ -42,7 +42,7 @@ Requires-Dist: flask-socketio==5.5.1
42
42
  Requires-Dist: flask==3.1.0
43
43
  Requires-Dist: gazu==0.10.31
44
44
  Requires-Dist: gevent-websocket==0.10.1
45
- Requires-Dist: gevent==24.11.1
45
+ Requires-Dist: gevent==25.4.1
46
46
  Requires-Dist: gunicorn==23.0.0
47
47
  Requires-Dist: isoweek==1.3.3
48
48
  Requires-Dist: itsdangerous==2.2.0
@@ -56,18 +56,18 @@ Requires-Dist: opencv-python==4.11.0.86
56
56
  Requires-Dist: OpenTimelineIO==0.17.0
57
57
  Requires-Dist: OpenTimelineIO-Plugins==0.17.0
58
58
  Requires-Dist: orjson==3.10.16
59
- Requires-Dist: pillow==11.1.0
59
+ Requires-Dist: pillow==11.2.1
60
60
  Requires-Dist: psutil==7.0.0
61
61
  Requires-Dist: psycopg[binary]==3.2.6
62
62
  Requires-Dist: pyotp==2.9.0
63
63
  Requires-Dist: pysaml2==7.5.2
64
64
  Requires-Dist: python-nomad==2.1.0
65
65
  Requires-Dist: python-slugify==8.0.4
66
- Requires-Dist: python-socketio==5.12.1
66
+ Requires-Dist: python-socketio==5.13.0
67
67
  Requires-Dist: pytz==2025.2
68
68
  Requires-Dist: redis==5.2.1
69
69
  Requires-Dist: requests==2.32.3
70
- Requires-Dist: rq==2.3.1
70
+ Requires-Dist: rq==2.3.2
71
71
  Requires-Dist: slackclient==2.9.4
72
72
  Requires-Dist: sqlalchemy_utils==0.41.2
73
73
  Requires-Dist: sqlalchemy==2.0.40
@@ -86,7 +86,7 @@ Requires-Dist: pytest==8.3.5; extra == "test"
86
86
  Provides-Extra: monitoring
87
87
  Requires-Dist: prometheus-flask-exporter==0.23.2; extra == "monitoring"
88
88
  Requires-Dist: pygelf==0.4.2; extra == "monitoring"
89
- Requires-Dist: sentry-sdk==2.25.1; extra == "monitoring"
89
+ Requires-Dist: sentry-sdk==2.26.1; extra == "monitoring"
90
90
  Provides-Extra: lint
91
91
  Requires-Dist: autoflake==2.3.1; extra == "lint"
92
92
  Requires-Dist: black==25.1.0; extra == "lint"
@@ -1,7 +1,7 @@
1
- zou/__init__.py,sha256=CiKA3TE6R01oyvtNw_rNBH1DEEAmpZITm9M-h70F1PQ,24
1
+ zou/__init__.py,sha256=EBK4BUKGDAx7AyYuIhT53iwcbOHpqHhJXAi0P1PU5MY,24
2
2
  zou/cli.py,sha256=HuYi2Ma7SP2SD7C9d9dwpZ49BHpytKIoyJP_su9JwZY,18755
3
3
  zou/debug.py,sha256=1fawPbkD4wn0Y9Gk0BiBFSa-CQe5agFi8R9uJYl2Uyk,520
4
- zou/event_stream.py,sha256=_BB_cwEpWOrHEhfxxgwzZgfAauekg0lrI5COume2XR8,6663
4
+ zou/event_stream.py,sha256=KljIebYRa3zyfxf1eO-ITIufv754zDdejKmgXmdekwE,7567
5
5
  zou/job_settings.py,sha256=_aqBhujt2Q8sXRWIbgbDf-LUdXRdBimdtTc-fZbiXoY,202
6
6
  zou/app/__init__.py,sha256=zGmaBGBHSS_Px34I3_WZmcse62G_AZJArjm4F6TwmRk,7100
7
7
  zou/app/api.py,sha256=JTB_IMVO8EOoyqx9KdRkiIix0chOLi0yGDY-verUJXA,5127
@@ -201,7 +201,7 @@ zou/app/services/names_service.py,sha256=TOSrintROmxcAlcFQE0i2E3PBLnw81GAztNselp
201
201
  zou/app/services/news_service.py,sha256=eOXkvLhOcgncI2NrgiJEccV28oxZX5CsZVqaE-l4kWQ,9084
202
202
  zou/app/services/notifications_service.py,sha256=7GDRio_mGaRYV5BHOAdpxBZjA_LLYUfVpbwZqy1n9pI,15685
203
203
  zou/app/services/persons_service.py,sha256=HjV-su80Y2BO9l5zoBKHMNF0mDGtkWqPhEOs3nQ3nlI,16566
204
- zou/app/services/playlists_service.py,sha256=Gs5K6jDJmnbdWqNvM3J0cOn0Lfxh_JtoPdEmqYXFSWk,32345
204
+ zou/app/services/playlists_service.py,sha256=OCq6CD9XSzH99Eipie8gyEBo8BAGQp2wEMbYKqHS9vw,32496
205
205
  zou/app/services/preview_files_service.py,sha256=Yk-vwzHuKTzNkEZfl9DhQRdDuRU006uwZxJ-RKajEkI,35842
206
206
  zou/app/services/projects_service.py,sha256=aIbYaFomy7OX2Pxvkf9w5qauDvkjuc9ummSGNYIpQMY,21249
207
207
  zou/app/services/scenes_service.py,sha256=iXN19HU4njPF5VtZXuUrVJ-W23ZQuQNPC3ADXltbWtU,992
@@ -420,9 +420,9 @@ zou/remote/normalize_movie.py,sha256=zNfEY3N1UbAHZfddGONTg2Sff3ieLVWd4dfZa1dpnes
420
420
  zou/remote/playlist.py,sha256=AsDo0bgYhDcd6DfNRV6r6Jj3URWwavE2ZN3VkKRPbLU,3293
421
421
  zou/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
422
422
  zou/utils/movie.py,sha256=d67fIL9dVBKt-E_qCGXRbNNdbJaJR5sHvZeX3hf8ldE,16559
423
- zou-0.20.35.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
424
- zou-0.20.35.dist-info/METADATA,sha256=2Bq8sfXkRJCkAJELu6sxbCnmQdLCaIo8yNeuM88cLAI,6695
425
- zou-0.20.35.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
426
- zou-0.20.35.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
427
- zou-0.20.35.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
428
- zou-0.20.35.dist-info/RECORD,,
423
+ zou-0.20.37.dist-info/licenses/LICENSE,sha256=dql8h4yceoMhuzlcK0TT_i-NgTFNIZsgE47Q4t3dUYI,34520
424
+ zou-0.20.37.dist-info/METADATA,sha256=qv5YA0qVkyMEJkdtBoYET90oQ8l6DfDoM7P64nfYeuM,6694
425
+ zou-0.20.37.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
426
+ zou-0.20.37.dist-info/entry_points.txt,sha256=PelQoIx3qhQ_Tmne7wrLY-1m2izuzgpwokoURwSohy4,130
427
+ zou-0.20.37.dist-info/top_level.txt,sha256=4S7G_jk4MzpToeDItHGjPhHx_fRdX52zJZWTD4SL54g,4
428
+ zou-0.20.37.dist-info/RECORD,,
File without changes