panther 4.2.0__py3-none-any.whl → 4.2.2__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.
- panther/__init__.py +1 -1
- panther/base_websocket.py +9 -5
- panther/cli/monitor_command.py +9 -2
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/METADATA +1 -1
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/RECORD +9 -9
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/LICENSE +0 -0
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/WHEEL +0 -0
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/entry_points.txt +0 -0
- {panther-4.2.0.dist-info → panther-4.2.2.dist-info}/top_level.txt +0 -0
panther/__init__.py
CHANGED
panther/base_websocket.py
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
import asyncio
|
4
|
-
import
|
4
|
+
import orjson as json
|
5
5
|
from multiprocessing.managers import SyncManager
|
6
6
|
from typing import TYPE_CHECKING, Literal
|
7
7
|
|
8
|
-
import
|
9
|
-
|
8
|
+
import logging
|
10
9
|
from panther import status
|
11
10
|
from panther.base_request import BaseRequest
|
12
11
|
from panther.configs import config
|
@@ -53,9 +52,14 @@ class WebsocketConnections(Singleton):
|
|
53
52
|
logger.info("Subscribed to 'websocket_connections' queue")
|
54
53
|
while True:
|
55
54
|
try:
|
56
|
-
received_message = queue.get
|
55
|
+
received_message = await asyncio.to_thread(queue.get)
|
56
|
+
if received_message is None:
|
57
|
+
# The None came from the CancelledError, so break the loop
|
58
|
+
break
|
57
59
|
await self._handle_received_message(received_message=received_message)
|
58
|
-
except InterruptedError:
|
60
|
+
except (InterruptedError, asyncio.CancelledError):
|
61
|
+
# Put the None to the queue, so the executor knows that it ends
|
62
|
+
queue.put(None)
|
59
63
|
break
|
60
64
|
else:
|
61
65
|
# We have a redis connection, so use it for pubsub
|
panther/cli/monitor_command.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import contextlib
|
2
2
|
import logging
|
3
3
|
import os
|
4
|
+
import platform
|
4
5
|
import signal
|
5
6
|
from collections import deque
|
6
7
|
from pathlib import Path
|
@@ -43,7 +44,12 @@ class Monitoring:
|
|
43
44
|
):
|
44
45
|
f.readlines() # Set cursor at the end of the file
|
45
46
|
|
46
|
-
|
47
|
+
if platform.system() == 'Windows':
|
48
|
+
watching = watch(self.monitoring_log_file, force_polling=True)
|
49
|
+
else:
|
50
|
+
watching = watch(self.monitoring_log_file)
|
51
|
+
|
52
|
+
for _ in watching:
|
47
53
|
for line in f.readlines():
|
48
54
|
self.rows.append(line.split('|'))
|
49
55
|
live.update(self.generate_table())
|
@@ -63,7 +69,8 @@ class Monitoring:
|
|
63
69
|
self.update_rows()
|
64
70
|
|
65
71
|
# Register the signal handler
|
66
|
-
|
72
|
+
if platform.system() != 'Windows':
|
73
|
+
signal.signal(signal.SIGWINCH, self.update_rows)
|
67
74
|
|
68
75
|
def generate_table(self) -> Panel:
|
69
76
|
# 2023-03-24 01:42:52 | GET | /user/317/ | 127.0.0.1:48856 | 0.0366 ms | 200
|
@@ -1,11 +1,11 @@
|
|
1
|
-
panther/__init__.py,sha256=
|
1
|
+
panther/__init__.py,sha256=Sv6vixQQrNOJFV4kgGUL-pMtNbXp7MrXCoCs7BYP6p0,110
|
2
2
|
panther/_load_configs.py,sha256=AVkoixkUFkBQiTmrLrwCmg0eiPW2U_Uw2EGNEGQRfnI,9281
|
3
3
|
panther/_utils.py,sha256=j0rwIxTf0rtcZAAD-1nGE-_bWpvinyKtnwt3uO0hMmY,4330
|
4
4
|
panther/app.py,sha256=e2eb4sXIaBje5vpcm4pbvvEO_sj83pLfBHCIZJFFX38,8222
|
5
5
|
panther/authentications.py,sha256=gf7BVyQ8vXKhiumJAtD0aAK7uIHWx_snbOKYAKrYuVw,5677
|
6
6
|
panther/background_tasks.py,sha256=HBYubDIiO_673cl_5fqCUP9zzimzRgRkDSkag9Msnbs,7656
|
7
7
|
panther/base_request.py,sha256=XD2v1gLWcCKHePowRxT6_fYnS4tdKFxTLINMX0HQu8M,3880
|
8
|
-
panther/base_websocket.py,sha256=
|
8
|
+
panther/base_websocket.py,sha256=L0tiQQjg7E3462cd91PMf_SoVMMK4YiwW45yTFdTLhY,10973
|
9
9
|
panther/caching.py,sha256=ltuJYdjNiAaKIs3jpO5EBpL8Y6CF1vAIQqh8J_Np10g,4098
|
10
10
|
panther/configs.py,sha256=EaLApT6nYcguBoNXBG_8n6DU6HTNxsulI2943j8UAkE,3174
|
11
11
|
panther/events.py,sha256=bxDqrfiNNBlvD03vEk2LDK4xbMzTMFVcgAjx2ein7mI,1158
|
@@ -29,7 +29,7 @@ panther/websocket.py,sha256=5WLw--Oa-6kGYbeRvO79hjbd0ARFcTTF40-hO_bdjmQ,1206
|
|
29
29
|
panther/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
panther/cli/create_command.py,sha256=mT5GFzsTYZbzqShNHlw_UIkMcWLw9btm2mTwcg7TlfI,10292
|
31
31
|
panther/cli/main.py,sha256=pCqnOTazgMhTvFHTugutIsiFXueU5kx2VmGngwAl54Q,1679
|
32
|
-
panther/cli/monitor_command.py,sha256=
|
32
|
+
panther/cli/monitor_command.py,sha256=sbnxQOSy0Q6GB-ELrfyoY6S-ZwgbI7eZyKx7YkvrEas,3383
|
33
33
|
panther/cli/run_command.py,sha256=yWcDoWC-c4ph4M5EDj0jvR9xSjh-apG5r6-NpDdArUo,2195
|
34
34
|
panther/cli/template.py,sha256=hVkY1A3HZDVGEZzRkMtYte6FagKGTAxoFeG0wot7Zn4,5320
|
35
35
|
panther/cli/utils.py,sha256=Jd4YQ9H6lapVktl7ZmiORt30WVmKI85xcwsY-fMRq3c,5289
|
@@ -49,9 +49,9 @@ panther/panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
panther/panel/apis.py,sha256=COsbwKZyTgyHvHYbpDfusifAH9ojMS3z1KhZCt9M-Ms,2428
|
50
50
|
panther/panel/urls.py,sha256=JiV-H4dWE-m_bfaTTVxzOxTvJmOWhyLOvcbM7xU3Bn4,240
|
51
51
|
panther/panel/utils.py,sha256=0Rv79oR5IEqalqwpRKQHMn1p5duVY5mxMqDKiA5mWx4,437
|
52
|
-
panther-4.2.
|
53
|
-
panther-4.2.
|
54
|
-
panther-4.2.
|
55
|
-
panther-4.2.
|
56
|
-
panther-4.2.
|
57
|
-
panther-4.2.
|
52
|
+
panther-4.2.2.dist-info/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
|
53
|
+
panther-4.2.2.dist-info/METADATA,sha256=WuUnOJAvGmczG9Mq0UJu0dKjaFLDqL6Vqvvh0cceGD0,6376
|
54
|
+
panther-4.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
55
|
+
panther-4.2.2.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
|
56
|
+
panther-4.2.2.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
|
57
|
+
panther-4.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|