wnox 0.6.0__tar.gz → 0.8.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: wnox
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: QE nexus client.
5
5
  Home-page: https://github.com/arminkardan/pywnox
6
6
  Author: Ethan (Armin) Cardan
@@ -9,7 +9,7 @@ Project-URL: homepage, https://github.com/arminkardan/pywnox
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.12
12
+ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.txt
15
15
  Requires-Dist: slixmpp
@@ -19,3 +19,13 @@ Dynamic: home-page
19
19
  Dynamic: requires-python
20
20
 
21
21
  QE nexus client.
22
+
23
+ How to upload to PyPi:
24
+
25
+ pip install build
26
+ pip install twine
27
+
28
+ python -m build
29
+ twine upload dist/*
30
+
31
+ pip install --upgrade --force-reinstall wnox
wnox-0.8.0/README.md ADDED
@@ -0,0 +1,11 @@
1
+ QE nexus client.
2
+
3
+ How to upload to PyPi:
4
+
5
+ pip install build
6
+ pip install twine
7
+
8
+ python -m build
9
+ twine upload dist/*
10
+
11
+ pip install --upgrade --force-reinstall wnox
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wnox"
7
- version = "0.6.0"
7
+ version = "0.8.0"
8
8
  authors = [{ name = "Ethan (Armin) Cardan", email = "armin.fire@gmail.com" }]
9
9
  description = "QE nexus client."
10
10
  readme = "README.md"
11
11
  license = { file = "LICENSE" }
12
12
  dependencies = ["slixmpp","bson"]
13
- requires-python = ">=3.12"
13
+ requires-python = ">=3.11"
14
14
  classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
16
  "License :: OSI Approved :: MIT License",
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="wnox",
5
- version="0.6.0",
5
+ version="0.8.0",
6
6
  packages=find_packages(),
7
7
  install_requires=[],
8
8
  author="Ethan (Armin) Cardan",
@@ -16,5 +16,5 @@ setup(
16
16
  "License :: OSI Approved :: MIT License",
17
17
  "Operating System :: OS Independent",
18
18
  ],
19
- python_requires=">=3.12",
19
+ python_requires=">=3.11",
20
20
  )
@@ -62,7 +62,7 @@ class WSX(ClientXMPP, EventEmitter):
62
62
  print("[bridge] connected.")
63
63
  self.send_presence(ptype="presence")
64
64
  await self.get_roster()
65
- await self.emit("connect",{})
65
+ await self.emit("__connect",{})
66
66
  self.connected = True
67
67
 
68
68
 
@@ -71,7 +71,7 @@ class WSX(ClientXMPP, EventEmitter):
71
71
 
72
72
  async def on_disconnect(self, event):
73
73
  """Handle disconnection and attempt reconnection."""
74
- await self.emit("disconnect",{})
74
+ await self.emit("__disconnect",{})
75
75
  self.connected = False
76
76
  asyncio.create_task(self.reconnect())
77
77
 
@@ -95,16 +95,27 @@ class WSX(ClientXMPP, EventEmitter):
95
95
  delayed = "urn:xmpp:delay" in str(stanza)
96
96
 
97
97
  if body and not delayed:
98
- user_uid = from_jid.split('@')[0]
98
+
99
99
 
100
100
  if body.startswith("{"):
101
101
  try:
102
102
  json_data = json.loads(body)
103
+ if "__connect" in json_data:
104
+ return
105
+ if "__disconnect" in json_data:
106
+ return
107
+ if "__message" in json_data:
108
+ return
109
+
103
110
  if "api" in json_data:
111
+ user_uid = from_jid.split('@')[0]
104
112
  data = {key: val for key, val in json_data.items() if key != "api"}
105
113
  data = {key: val for key, val in data.items() if key != "mid"}
106
-
107
- if True or len(user_uid) == 24 and ObjectId.is_valid(user_uid):
114
+ data["from"] = from_jid
115
+ data["app"] = None
116
+ if len(user_uid) == 24 and ObjectId.is_valid(user_uid):
117
+ data["uid"] = user_uid
118
+ data["app"] = None
108
119
  result = await self.emit(json_data["api"], data)
109
120
  if result == None:
110
121
  result = {}
@@ -112,6 +123,14 @@ class WSX(ClientXMPP, EventEmitter):
112
123
  mto=from_jid,
113
124
  mbody=json.dumps({**result, "mid": json_data.get("mid")})
114
125
  )
126
+ elif "conference.qepal.com" in from_jid:
127
+ pass
128
+ elif "-" in user_uid:
129
+ app = user_uid.split('-')[0]
130
+ user_uid = user_uid.split('-')[1]
131
+ data["app"] = app
132
+ data["uid"] = user_uid
133
+
115
134
  else:
116
135
  if "mid" in json_data:
117
136
  data = {key: val for key, val in json_data.items() if key != "mid"}
@@ -119,12 +138,12 @@ class WSX(ClientXMPP, EventEmitter):
119
138
  if json_data.get("mid") in eventsx:
120
139
  eventsx.get(json_data.get("mid")).set()
121
140
  else:
122
- await self.emit("message", {"from": from_jid, "body": body, "itsme": itsme, "itsbro": itsbro})
141
+ await self.emit("__message", {"from": from_jid, "body": body, "itsme": itsme, "itsbro": itsbro})
123
142
 
124
143
  except json.JSONDecodeError:
125
144
  pass
126
145
  else:
127
- await self.emit("message", {"from": from_jid, "body": body, "itsme": itsme, "itsbro": itsbro})
146
+ await self.emit("__message", {"from": from_jid, "body": body, "itsme": itsme, "itsbro": itsbro})
128
147
 
129
148
 
130
149
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: wnox
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: QE nexus client.
5
5
  Home-page: https://github.com/arminkardan/pywnox
6
6
  Author: Ethan (Armin) Cardan
@@ -9,7 +9,7 @@ Project-URL: homepage, https://github.com/arminkardan/pywnox
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.12
12
+ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.txt
15
15
  Requires-Dist: slixmpp
@@ -19,3 +19,13 @@ Dynamic: home-page
19
19
  Dynamic: requires-python
20
20
 
21
21
  QE nexus client.
22
+
23
+ How to upload to PyPi:
24
+
25
+ pip install build
26
+ pip install twine
27
+
28
+ python -m build
29
+ twine upload dist/*
30
+
31
+ pip install --upgrade --force-reinstall wnox
wnox-0.6.0/README.md DELETED
@@ -1 +0,0 @@
1
- QE nexus client.
File without changes
File without changes
File without changes
File without changes
File without changes