Select Git revision
db_schema.sql
Forked from
Video AG Infrastruktur / website
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
02-remove-xmpp.patch 4.12 KiB
diff --git a/painintheapt b/painintheapt
index 5fd816d..505b160 100755
--- a/painintheapt
+++ b/painintheapt
@@ -23,7 +23,6 @@ import urllib.request
# additional modules
import apt
import prettytable
-import sleekxmpp
longname = "Pain in the APT"
shortname = "painintheapt"
@@ -118,54 +117,6 @@ def maketable(lst):
return table.get_string()
-class JabberBot(sleekxmpp.ClientXMPP):
- def __init__(self, jid, password, to, room, pubsub_service, pubsub_node,
- nick, subject, message):
- sleekxmpp.ClientXMPP.__init__(self, jid, password)
- self.to = to
- self.room = room
- self.pubsub_service = pubsub_service
- self.pubsub_node = pubsub_node
- self.nick = nick
- self.add_event_handler("session_start", self.start)
- self.subject = subject
- self.message = message
-
- def start(self, event):
- self.getRoster()
- self.sendPresence()
- for to in self.to:
- self.send_message(
- mto=to,
- msubject=self.subject,
- # subject is not shown by all clients, better add it to body
- mbody="\n".join([self.subject, self.message]),
- mtype='chat')
- if self.room:
- self.plugin['xep_0045'].joinMUC(self.room, self.nick, wait=True)
- self.send_message(
- mto=self.room,
- # no per message subject in groupchats, add it to message body
- mbody="\n".join([self.subject, self.message]),
- mtype='groupchat')
- if self.pubsub_service and self.pubsub_node:
- payload = '<entry xmlns="http://www.w3.org/2005/Atom"><title>' \
- + html.escape(self.subject) \
- + '</title><content type="xhtml">' \
- + '<pre xmlns="http://www.w3.org/1999/xhtml">' \
- + html.escape(self.message) \
- + '</pre></content></entry>'
- self['xep_0060'].publish(
- self.pubsub_service, self.pubsub_node,
- payload=sleekxmpp.xmlstream.ET.fromstring(payload))
- try:
- self.disconnect(wait=True)
- except TypeError: # older SleekXMPP doesn't have "wait"
- import time
- time.sleep(10)
- self.disconnect()
-
-
def read_password(config, config_dir):
password_file = config.get("password_file", "").strip()
if len(password_file):
@@ -177,31 +128,6 @@ def read_password(config, config_dir):
return config.get("password", "")