neuronum 1.2.2__py3-none-any.whl → 1.2.3__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 neuronum might be problematic. Click here for more details.
- neuronum/neuronum.py +31 -28
- {neuronum-1.2.2.dist-info → neuronum-1.2.3.dist-info}/METADATA +1 -1
- neuronum-1.2.3.dist-info/RECORD +7 -0
- neuronum-1.2.2.dist-info/RECORD +0 -7
- {neuronum-1.2.2.dist-info → neuronum-1.2.3.dist-info}/LICENSE +0 -0
- {neuronum-1.2.2.dist-info → neuronum-1.2.3.dist-info}/WHEEL +0 -0
- {neuronum-1.2.2.dist-info → neuronum-1.2.3.dist-info}/top_level.txt +0 -0
neuronum/neuronum.py
CHANGED
|
@@ -209,35 +209,38 @@ class Cell:
|
|
|
209
209
|
|
|
210
210
|
def sync(self, stx: Optional[str] = None) -> List[str]:
|
|
211
211
|
stream = []
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
ws = create_connection(f"wss://{self.network}/sync/{stx}")
|
|
220
|
-
ws.settimeout(1)
|
|
221
|
-
print(f"Auth Payload: {auth}")
|
|
222
|
-
ws.send(json.dumps(auth))
|
|
223
|
-
|
|
224
|
-
except Exception as e:
|
|
225
|
-
print(f"Failed to connect: {e}")
|
|
226
|
-
return stream
|
|
212
|
+
auth = {
|
|
213
|
+
"host": self.host,
|
|
214
|
+
"password": self.password,
|
|
215
|
+
"synapse": self.synapse,
|
|
216
|
+
}
|
|
217
|
+
print(f"Auth Payload: {auth}")
|
|
227
218
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
219
|
+
while True:
|
|
220
|
+
try:
|
|
221
|
+
ws = create_connection(f"wss://{self.network}/sync/{stx}")
|
|
222
|
+
ws.settimeout(1) # Set timeout for receiving data
|
|
223
|
+
ws.send(json.dumps(auth))
|
|
224
|
+
print("Connected to WebSocket.")
|
|
225
|
+
|
|
226
|
+
while True:
|
|
227
|
+
try:
|
|
228
|
+
message = ws.recv()
|
|
229
|
+
print(f"Received Data: {message}")
|
|
230
|
+
stream.append(message)
|
|
231
|
+
except socket.timeout:
|
|
232
|
+
# Timeout occurred, but keep the connection open
|
|
233
|
+
print("Timeout occurred, no data received.")
|
|
234
|
+
except KeyboardInterrupt:
|
|
235
|
+
print("Closing connection...")
|
|
236
|
+
ws.close()
|
|
237
|
+
return stream
|
|
238
|
+
except Exception as e:
|
|
239
|
+
print(f"Connection failed: {e}")
|
|
240
|
+
finally:
|
|
241
|
+
if ws:
|
|
242
|
+
ws.close()
|
|
243
|
+
print("Connection closed, retrying...")
|
|
240
244
|
|
|
241
|
-
return stream
|
|
242
245
|
|
|
243
246
|
__all__ = ['Cell']
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
2
|
+
neuronum/neuronum.py,sha256=SexnB-knTtsJIa1zjLoW11W3yVbjeM2ytz79TbTMX_k,7637
|
|
3
|
+
neuronum-1.2.3.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
+
neuronum-1.2.3.dist-info/METADATA,sha256=AnPbAHXlSKzNRSEgTiSdGQgo0dQYpfBPmfkDzfKDwBE,3423
|
|
5
|
+
neuronum-1.2.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
+
neuronum-1.2.3.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
7
|
+
neuronum-1.2.3.dist-info/RECORD,,
|
neuronum-1.2.2.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
2
|
-
neuronum/neuronum.py,sha256=Y0BMTTfBM3E9scEM57aDNj6wkwRH6yA0XwLj0nohodQ,7290
|
|
3
|
-
neuronum-1.2.2.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
-
neuronum-1.2.2.dist-info/METADATA,sha256=nHWQUddV45PHdXejJxwxgca6fhrWk_9OcVrKOnTRSss,3423
|
|
5
|
-
neuronum-1.2.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
-
neuronum-1.2.2.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
7
|
-
neuronum-1.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|