satori-python 0.17.0__tar.gz → 0.17.1__tar.gz
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.
- {satori_python-0.17.0 → satori_python-0.17.1}/PKG-INFO +1 -1
- {satori_python-0.17.0 → satori_python-0.17.1}/pyproject.toml +1 -1
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/__init__.py +1 -1
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/__init__.py +4 -4
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/network/webhook.py +3 -3
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/network/websocket.py +7 -7
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/__init__.py +2 -2
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/connection.py +1 -1
- {satori_python-0.17.0 → satori_python-0.17.1}/LICENSE +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/README.md +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/account.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/account.pyi +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/config.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/network/__init__.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/network/base.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/network/util.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/client/protocol.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/const.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/element.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/event.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/exception.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/model.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/parser.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/adapter.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/formdata.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/model.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/route.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/server/utils.py +0 -0
- {satori_python-0.17.0 → satori_python-0.17.1}/src/satori/utils.py +0 -0
|
@@ -213,7 +213,7 @@ class App(Service):
|
|
|
213
213
|
if not login.user:
|
|
214
214
|
logger.warning(f"Received login-added event without user info: {login}")
|
|
215
215
|
return
|
|
216
|
-
login_sn = f"{login.user.id}@{id(conn)}"
|
|
216
|
+
login_sn = f"{login.user.id}@{id(conn):x}"
|
|
217
217
|
account = Account(
|
|
218
218
|
login,
|
|
219
219
|
conn.config,
|
|
@@ -232,7 +232,7 @@ class App(Service):
|
|
|
232
232
|
if not login.user:
|
|
233
233
|
logger.warning(f"Received login-updated event without user info: {login}")
|
|
234
234
|
return
|
|
235
|
-
login_sn = f"{login.user.id}@{id(conn)}"
|
|
235
|
+
login_sn = f"{login.user.id}@{id(conn):x}"
|
|
236
236
|
if login_sn not in self.accounts:
|
|
237
237
|
if login.status == LoginStatus.ONLINE:
|
|
238
238
|
account = Account(
|
|
@@ -266,13 +266,13 @@ class App(Service):
|
|
|
266
266
|
if not login.user:
|
|
267
267
|
logger.warning(f"Received login-removed event without user info: {login}")
|
|
268
268
|
return
|
|
269
|
-
login_sn = f"{login.user.id}@{id(conn)}"
|
|
269
|
+
login_sn = f"{login.user.id}@{id(conn):x}"
|
|
270
270
|
if login_sn not in self.accounts:
|
|
271
271
|
logger.warning(f"Received event for unknown account: {event}")
|
|
272
272
|
return
|
|
273
273
|
account = self.accounts[login_sn]
|
|
274
274
|
else:
|
|
275
|
-
login_sn = f"{event.login.user.id}@{id(conn)}"
|
|
275
|
+
login_sn = f"{event.login.user.id}@{id(conn):x}"
|
|
276
276
|
if login_sn not in self.accounts:
|
|
277
277
|
logger.warning(f"Received event for unknown account: {event}")
|
|
278
278
|
return
|
|
@@ -23,7 +23,7 @@ class WebhookNetwork(BaseNetwork[WebhookInfo]):
|
|
|
23
23
|
|
|
24
24
|
@property
|
|
25
25
|
def id(self):
|
|
26
|
-
return f"satori/
|
|
26
|
+
return f"satori/net/wh/{self.config.identity}#{id(self):x}"
|
|
27
27
|
|
|
28
28
|
async def handle_request(self, req: web.Request):
|
|
29
29
|
header = req.headers
|
|
@@ -105,7 +105,7 @@ class WebhookNetwork(BaseNetwork[WebhookInfo]):
|
|
|
105
105
|
for login in meta.logins:
|
|
106
106
|
if not login.user:
|
|
107
107
|
continue
|
|
108
|
-
login_sn = f"{login.user.id}@{id(self)}"
|
|
108
|
+
login_sn = f"{login.user.id}@{id(self):x}"
|
|
109
109
|
account = Account(login, self.config, meta.proxy_urls, self.app.default_api_cls)
|
|
110
110
|
logger.info(f"account registered: {account}")
|
|
111
111
|
(account.connected.set() if login.status == LoginStatus.ONLINE else account.connected.clear())
|
|
@@ -117,7 +117,7 @@ class WebhookNetwork(BaseNetwork[WebhookInfo]):
|
|
|
117
117
|
logger.info(f"{self.id} Webhook server exiting...")
|
|
118
118
|
self.close_signal.set()
|
|
119
119
|
for v in list(self.app.accounts.values()):
|
|
120
|
-
if (identity := f"{v.self_id}@{id(self)}") in self.accounts:
|
|
120
|
+
if (identity := f"{v.self_id}@{id(self):x}") in self.accounts:
|
|
121
121
|
v.connected.clear()
|
|
122
122
|
await self.app.account_update(v, LoginStatus.OFFLINE)
|
|
123
123
|
del self.app.accounts[identity]
|
|
@@ -23,7 +23,7 @@ class WsNetwork(BaseNetwork[WebsocketsInfo]):
|
|
|
23
23
|
|
|
24
24
|
@property
|
|
25
25
|
def id(self):
|
|
26
|
-
return f"satori/
|
|
26
|
+
return f"satori/net/ws/{self.config.identity}#{id(self):x}"
|
|
27
27
|
|
|
28
28
|
connection: aiohttp.ClientWebSocketResponse | None = None
|
|
29
29
|
|
|
@@ -107,7 +107,7 @@ class WsNetwork(BaseNetwork[WebsocketsInfo]):
|
|
|
107
107
|
for login in ready.logins:
|
|
108
108
|
if not login.user:
|
|
109
109
|
continue
|
|
110
|
-
login_sn = f"{login.user.id}@{id(self)}"
|
|
110
|
+
login_sn = f"{login.user.id}@{id(self):x}"
|
|
111
111
|
if login_sn in self.app.accounts:
|
|
112
112
|
account = self.app.accounts[login_sn]
|
|
113
113
|
self.accounts[login_sn] = account
|
|
@@ -162,7 +162,7 @@ class WsNetwork(BaseNetwork[WebsocketsInfo]):
|
|
|
162
162
|
self.close_signal.set()
|
|
163
163
|
self.connection = None
|
|
164
164
|
for v in list(self.app.accounts.values()):
|
|
165
|
-
if (identity := f"{v.self_id}@{id(self)}") in self.accounts:
|
|
165
|
+
if (identity := f"{v.self_id}@{id(self):x}") in self.accounts:
|
|
166
166
|
v.connected.clear()
|
|
167
167
|
await self.app.account_update(v, LoginStatus.OFFLINE)
|
|
168
168
|
del self.app.accounts[identity]
|
|
@@ -170,7 +170,7 @@ class WsNetwork(BaseNetwork[WebsocketsInfo]):
|
|
|
170
170
|
return
|
|
171
171
|
if close_task in done:
|
|
172
172
|
receiver_task.cancel()
|
|
173
|
-
logger.warning(f"{self} Connection closed by server, will reconnect in 5 seconds...")
|
|
173
|
+
logger.warning(f"{self.id} Connection closed by server, will reconnect in 5 seconds...")
|
|
174
174
|
for k in self.accounts.keys():
|
|
175
175
|
logger.debug(f"Unregistering satori account {k}...")
|
|
176
176
|
account = self.app.accounts[k]
|
|
@@ -178,12 +178,12 @@ class WsNetwork(BaseNetwork[WebsocketsInfo]):
|
|
|
178
178
|
await self.app.account_update(account, LoginStatus.RECONNECT)
|
|
179
179
|
self.accounts.clear()
|
|
180
180
|
await asyncio.sleep(5)
|
|
181
|
-
logger.info(f"{self} Reconnecting...")
|
|
181
|
+
logger.info(f"{self.id} Reconnecting...")
|
|
182
182
|
continue
|
|
183
183
|
except Exception as e:
|
|
184
|
-
logger.error(f"{self} Error while connecting: {e}")
|
|
184
|
+
logger.error(f"{self.id} Error while connecting: {e}")
|
|
185
185
|
await asyncio.sleep(5)
|
|
186
|
-
logger.info(f"{self} Reconnecting...")
|
|
186
|
+
logger.info(f"{self.id} Reconnecting...")
|
|
187
187
|
|
|
188
188
|
async def launch(self, manager: Launart):
|
|
189
189
|
async with self.stage("preparing"):
|
|
@@ -264,7 +264,7 @@ class Server(Service, RouterMixin):
|
|
|
264
264
|
{"op": Opcode.READY, "body": {"logins": [lo.dump() for lo in logins], "proxy_urls": proxy_urls}}
|
|
265
265
|
)
|
|
266
266
|
self.connections.append(connection)
|
|
267
|
-
logger.debug(f"New connection: {id(connection)}")
|
|
267
|
+
logger.debug(f"New connection: {id(connection):x}")
|
|
268
268
|
heartbeat_task = asyncio.create_task(connection.heartbeat())
|
|
269
269
|
close_task = asyncio.create_task(connection.close_signal.wait())
|
|
270
270
|
try:
|
|
@@ -281,7 +281,7 @@ class Server(Service, RouterMixin):
|
|
|
281
281
|
await any_completed(heartbeat_task, close_task)
|
|
282
282
|
finally:
|
|
283
283
|
await connection.connection_closed()
|
|
284
|
-
logger.debug(f"Connection closed: {id(connection)}")
|
|
284
|
+
logger.debug(f"Connection closed: {id(connection):x}")
|
|
285
285
|
heartbeat_task.cancel()
|
|
286
286
|
close_task.cancel()
|
|
287
287
|
self.connections.remove(connection)
|
|
@@ -29,7 +29,7 @@ class WebsocketConnection:
|
|
|
29
29
|
continue
|
|
30
30
|
await self.connection.send_text(encode({"op": Opcode.PONG}))
|
|
31
31
|
except asyncio.TimeoutError:
|
|
32
|
-
logger.warning(f"Connection {id(self)} heartbeat timeout, closing connection.")
|
|
32
|
+
logger.warning(f"Connection {id(self):x} heartbeat timeout, closing connection.")
|
|
33
33
|
await self.connection.close()
|
|
34
34
|
await self.connection_closed()
|
|
35
35
|
break
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|