Add file PyProject;

Support display of a single pubsub node item;
Update document README;
Modularize code;
This commit is contained in:
Schimon Jehudah, Adv. 2024-11-17 17:30:38 +02:00
parent 37aa7e8f40
commit 5e495579c2
32 changed files with 2431 additions and 2059 deletions

View file

@ -0,0 +1,34 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from asyncio import TimeoutError
from slixmpp.exceptions import IqError, IqTimeout, PresenceError
class XmppXep0369:
async def get_room_information(self, jid, alias):
iq = await self['xep_0369'].join_channel(jid, alias)
breakpoint()
print('GOOD DAY! Please contact the developer!')
try:
error = False
condition = text = ''
#iq = await self['xep_0369'].get_channel_info(jid)
iq = await self['xep_0369'].join_channel(jid, alias)
except TimeoutError as e:
#raise HTTPException(status_code=504, detail='request-timeout-reached')
error = True
iq = e
condition = 'Request timeout reached'
text = str(e)
except (IqError, IqTimeout, PresenceError) as e:
error = True
iq = e
condition = e.iq['error']['condition']
text = e.iq['error']['text']
result = {
'error' : error,
'condition' : condition,
'text' : text,
'iq' : iq}
return result