-
Notifications
You must be signed in to change notification settings - Fork 0
/
stabber.py
38 lines (27 loc) · 1.05 KB
/
stabber.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from ctypes import *
class Stabber:
def __init__(self, loglevel, port, httpport):
self.libstabber = CDLL("libstabber.so.0")
self.loglevel = loglevel
self.port = port
self.httpport = httpport
def start(self):
self.libstabber.stbbr_start(self.loglevel, self.port, self.httpport)
def set_timeout(self, timeout):
self.libstabber.stbbr_set_timeout(timeout)
def auth_password(self, password):
self.libstabber.stbbr_auth_password(password)
def for_id(self, idattr, stream):
self.libstabber.stbbr_for_id(idattr, stream)
def for_query(self, query, stream):
self.libstabber.stbbr_for_query(query, stream)
def wait_for(self, idattr):
self.libstabber.stbbr_wait_for(idattr)
def received(self, stanza):
self.libstabber.stbbr_received(stanza)
def last_received(self, stanza):
self.libstabber.stbbr_last_received(stanza)
def send(self, message):
self.libstabber.stbbr_send(message)
def stop(self):
self.libstabber.stbbr_stop()