vuer 0.0.35rc16__py3-none-any.whl → 0.0.35rc17__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.

Potentially problematic release.


This version of vuer might be problematic. Click here for more details.

Binary file
@@ -577,11 +577,11 @@ class Glb(SceneElement):
577
577
  """Glb Component
578
578
 
579
579
  # this follows the material type
580
+
580
581
  :param materialType: Literal["basic", ...]
581
582
  :param material: {
582
583
  side=0: inside, side=1: outsie, side=2: both.
583
584
  }
584
-
585
585
  """
586
586
 
587
587
  tag = "Glb"
vuer/server.py CHANGED
@@ -89,9 +89,7 @@ class VuerSession:
89
89
  :return: dqueue
90
90
  """
91
91
  assert isinstance(event, ServerEvent), "msg must be a ServerEvent type object."
92
- assert not isinstance(
93
- event, Frame
94
- ), "Frame event is only used in vuer.bind method."
92
+ assert not isinstance(event, Frame), "Frame event is only used in vuer.bind method."
95
93
  assert self.CURRENT_WS_ID in self.vuer.ws, "Websocket session is missing."
96
94
 
97
95
  event_obj = event.serialize()
@@ -108,9 +106,7 @@ class VuerSession:
108
106
  :param subsample: The subsample of the render.
109
107
  :param ttl: The time to live for the handler. If the handler is not called within the time it gets removed from the handler list.
110
108
  """
111
- assert (
112
- self.CURRENT_WS_ID is not None
113
- ), "Websocket session is missing. CURRENT_WS_ID is None."
109
+ assert self.CURRENT_WS_ID is not None, "Websocket session is missing. CURRENT_WS_ID is None."
114
110
 
115
111
  event = GrabRender(**kwargs)
116
112
 
@@ -253,25 +249,23 @@ class VuerSession:
253
249
  yield from self.downlink_queue
254
250
 
255
251
  def spawn_task(self, task, name=None):
256
- """Spawn a task in the running asyncio event loop.
252
+ """Spawn a task in the running asyncio event loop
257
253
 
258
254
  Useful for background tasks. Returns an asyncio task that can be canceled.
259
255
 
260
- Example Usage:
261
-
262
256
  .. code-block:: python
257
+ :linenos:
263
258
 
264
259
  async background_task():
265
- print('\rthis ran once')
260
+ print('\\rthis ran once')
266
261
 
267
262
  async long_running_bg_task():
268
263
  while True:
269
264
  await asyncio.sleep(1.0)
270
- print("\rlong running background task is still running")
265
+ print("\\rlong running background task is still running")
271
266
 
272
267
  @app.spawn_task
273
268
  async def main_fn(sess: VuerSession):
274
-
275
269
  # Prepare background tasks here:
276
270
  task = sess.spawn_task(background_task)
277
271
  long_running_task = sess.spawn_task(long_running_bg_task)
@@ -279,13 +273,18 @@ class VuerSession:
279
273
  Now to cancel a running task, simply
280
274
 
281
275
  .. code-block:: python
276
+ :linenos:
282
277
 
283
278
  task.cancel()
284
279
 
280
+ **Todos**
281
+
282
+ ▫️ Add a way to automatically clean up when exiting the main_fn.
285
283
  """
286
284
  loop = asyncio.get_running_loop()
287
285
  return loop.create_task(task, name=name)
288
286
 
287
+
289
288
  DEFAULT_PORT = 8012
290
289
 
291
290
 
@@ -328,9 +327,7 @@ class Vuer(PrefixProto, Server):
328
327
  free_port: bool = Flag("Kill what is running on the requested port if True.")
329
328
  static_root: str = Proto(".", help="root for file serving")
330
329
  """todo: we want to support multiple paths."""
331
- queue_len: int = Proto(
332
- 100, help="use a max length to avoid the memory from blowing up."
333
- )
330
+ queue_len: int = Proto(100, help="use a max length to avoid the memory from blowing up.")
334
331
  cors = Proto(
335
332
  "https://vuer.ai,https://staging.vuer.ai,https://dash.ml,http://localhost:8000,http://127.0.0.1:8000,*",
336
333
  help="domains that are allowed for cross origin requests.",
@@ -508,9 +505,7 @@ class Vuer(PrefixProto, Server):
508
505
  ws = self.ws[ws_id]
509
506
 
510
507
  if event_bytes is None:
511
- assert isinstance(
512
- event, ServerEvent
513
- ), "event must be a ServerEvent type object."
508
+ assert isinstance(event, ServerEvent), "event must be a ServerEvent type object."
514
509
  event_obj = event.serialize()
515
510
  event_bytes = packb(event_obj, use_single_float=True, use_bin_type=True)
516
511
  else:
@@ -534,9 +529,7 @@ class Vuer(PrefixProto, Server):
534
529
  rpc_event = asyncio.Event()
535
530
  response = None
536
531
 
537
- async def response_handler(
538
- response_event: ClientEvent, _: "VuerSession"
539
- ) -> None:
532
+ async def response_handler(response_event: ClientEvent, _: "VuerSession") -> None:
540
533
  nonlocal response
541
534
 
542
535
  response = response_event
@@ -758,9 +751,7 @@ class Vuer(PrefixProto, Server):
758
751
  """
759
752
  headers = request.headers
760
753
  if "websocket" != headers.get(UPGRADE, "").lower().strip():
761
- return await handle_file_request(
762
- request, self.client_root, filename="index.html"
763
- )
754
+ return await handle_file_request(request, self.client_root, filename="index.html")
764
755
  else:
765
756
  return await websocket_handler(request, self.downlink)
766
757
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vuer
3
- Version: 0.0.35rc16
3
+ Version: 0.0.35rc17
4
4
  Home-page: https://github.com/vuer-ai/vuer
5
5
  Author: Ge Yang<ge.ike.yang@gmail.com>
6
6
  Author-email: ge.ike.yang@gmail.com
@@ -2,13 +2,13 @@ vuer/__init__.py,sha256=kbjORSc64WWVHcx3eJB1wnCzhIF76eX5g-JAXYEDM4Q,519
2
2
  vuer/base.py,sha256=oZWLC1QJ-Oa3ekCtqu3sVLgvUF2Mp7brgtv0OF4uXSI,4226
3
3
  vuer/events.py,sha256=FFNCEXFZDIEvNV58ZWOZE4Xg-Qf60YJ6w6MLlyOAfiw,7931
4
4
  vuer/serdes.py,sha256=GcUTcNwFj2rd-H9Konnud3w1hs7_ACdKzhDuHbnOaB0,2606
5
- vuer/server.py,sha256=rnloKsbaLI5eW0dBhMi39F44lv3cuwZOOGUP7BMiW6s,24445
5
+ vuer/server.py,sha256=kjTXTOjlIyiJpun_3HJyJQ40BJRoaYP1KKMGyEEWosY,24420
6
6
  vuer/types.py,sha256=N2KLa0fl6z8Jm6cJwZoD8Vqrins_AayG5BCGk1p3Eek,1279
7
7
  vuer/__pycache__/__init__.cpython-38.pyc,sha256=9UiyDbGVhzENW5OZYxPZhMK1kVGNV6sTlNFK1Soetdk,652
8
8
  vuer/__pycache__/base.cpython-38.pyc,sha256=-6Ys76_bhj6Eozvh56583kc5JbwMWXa31pCowRCRavY,4789
9
9
  vuer/__pycache__/events.cpython-38.pyc,sha256=Uvjj__OHltPlyjcaCpOvEQMHFePDW2UdQnAHt9ORi1A,9952
10
10
  vuer/__pycache__/serdes.cpython-38.pyc,sha256=dq4IFqiPsgG26p7ZAd09ehhCTkzsvGTtu8NYck1qBDU,2263
11
- vuer/__pycache__/server.cpython-38.pyc,sha256=atzGjS3kV4fUrr3DNp9FVP5zqYj49_6190dzAwXe_a8,22453
11
+ vuer/__pycache__/server.cpython-38.pyc,sha256=jEjRV5_-_OrzxDlagGB2EslIIamlm_GVk9_nxux_rFU,22523
12
12
  vuer/__pycache__/types.cpython-38.pyc,sha256=gFDjQdMS1v8bepQASOfKZ9rx_aWLsX7DNjcZl4sAVBI,1827
13
13
  vuer/addons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  vuer/addons/camera_rtc.py,sha256=sT2JjIDCCFacXs9AMrFm2aO3O49n_8iCSRNOjl2P-Yk,5165
@@ -237,16 +237,16 @@ vuer/schemas/__init__.py,sha256=7jNpbDMe486a-hizs1YdxkyFeLDAFFtWFWoq9mf1OII,128
237
237
  vuer/schemas/drei_components.py,sha256=U9svEOnNprhZaobLagaFnqEtZxo5hiriSqjDnvQutoA,6989
238
238
  vuer/schemas/html_components.py,sha256=28KuxiSoLi0W7LLK81QqyZbBQ6IsK5HyQqWN86ZlUuo,6759
239
239
  vuer/schemas/physics_components.py,sha256=kouKUZU8sI6vla8Gx6mGhzxOg-xEkYj4pTe2RqpUEeI,1340
240
- vuer/schemas/scene_components.py,sha256=f8-rJIFyQjxJoRPVJuQFlqHHt4Yv52-Cf25fM8eLSBQ,22642
240
+ vuer/schemas/scene_components.py,sha256=bpFV6hxJKIuiJ-j2ny5u4jfNpAAxasmfTEe_0Al6E0k,22642
241
241
  vuer/schemas/timeline_components.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
242
242
  vuer/schemas/__pycache__/__init__.cpython-38.pyc,sha256=JVAMGHEJOOM6nsxRTHXrzpmzbRC3DMdm5YqHogmxeac,259
243
243
  vuer/schemas/__pycache__/drei_components.cpython-38.pyc,sha256=YzK4Sa888xt8OhOPsx2L3iEQEU4ZGS5AwrcsQHNzN1E,7720
244
244
  vuer/schemas/__pycache__/html_components.cpython-38.pyc,sha256=et9rfXXph4c6sBBzL7Hwptff3-nscvnxoIIH9xOK-9o,8753
245
245
  vuer/schemas/__pycache__/physics_components.cpython-38.pyc,sha256=DvetxsLdYiYVgUtLvmsTZY4zNB8HQmlrY6q-2IYSgy4,1274
246
- vuer/schemas/__pycache__/scene_components.cpython-38.pyc,sha256=RLYyzOqcWKOzilfdM5mwOqin4ohHdTr8dWqrbpEIVhI,25417
247
- vuer-0.0.35rc16.dist-info/LICENSE,sha256=MGF-inVBUaGe2mEjqT0g6XsHIXwoNXgNHqD7Z1MzR0k,1063
248
- vuer-0.0.35rc16.dist-info/METADATA,sha256=p6k-0ZBGYoM6_P5n86MOgnMWgFID9EQ2sfDLhisL0SI,5659
249
- vuer-0.0.35rc16.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
250
- vuer-0.0.35rc16.dist-info/entry_points.txt,sha256=J_NM6fbpipmD9oP7cdxd1UyBR8mVEQVx0xjlE_56yss,41
251
- vuer-0.0.35rc16.dist-info/top_level.txt,sha256=ermmVkwvGFAK4gfSgDIwOmKpxwpqNt-oo7gVQQUSHok,5
252
- vuer-0.0.35rc16.dist-info/RECORD,,
246
+ vuer/schemas/__pycache__/scene_components.cpython-38.pyc,sha256=aNlSvyVVjli_eRaqhDYbENBH4GZzYaWYs-6C93fmgps,25417
247
+ vuer-0.0.35rc17.dist-info/LICENSE,sha256=MGF-inVBUaGe2mEjqT0g6XsHIXwoNXgNHqD7Z1MzR0k,1063
248
+ vuer-0.0.35rc17.dist-info/METADATA,sha256=ZLVirYMmtQtiZfOi-CIBFnkwIbOF8RhgIHWvjBBA9oM,5659
249
+ vuer-0.0.35rc17.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
250
+ vuer-0.0.35rc17.dist-info/entry_points.txt,sha256=J_NM6fbpipmD9oP7cdxd1UyBR8mVEQVx0xjlE_56yss,41
251
+ vuer-0.0.35rc17.dist-info/top_level.txt,sha256=ermmVkwvGFAK4gfSgDIwOmKpxwpqNt-oo7gVQQUSHok,5
252
+ vuer-0.0.35rc17.dist-info/RECORD,,