Modularize code;

Add packaging instructions;
Add modules to handle Gemini file type (no Gemini server yet);
Improve handling of configuration.
This commit is contained in:
Schimon Jehudah, Adv. 2024-11-12 15:25:05 +02:00
parent 84e54085b5
commit 766e51af4c
46 changed files with 2359 additions and 663 deletions

27
xmpp/xep_0060.py Normal file
View file

@ -0,0 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from slixmpp.exceptions import IqError, IqTimeout
class XmppXep0060:
async def get_node_item(self, pubsub, node, item_id):
try:
iq = await self.plugin['xep_0060'].get_item(pubsub, node, item_id, timeout=5)
return iq
except (IqError, IqTimeout) as e:
print(e)
async def get_node_items(self, pubsub, node):
try:
iq = await self.plugin['xep_0060'].get_items(pubsub, node, timeout=5)
return iq
except (IqError, IqTimeout) as e:
print(e)
async def get_nodes(self, pubsub):
try:
iq = await self.plugin['xep_0060'].get_nodes(pubsub, timeout=5)
return iq
except (IqError, IqTimeout) as e:
print(e)