-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
executable file
·58 lines (39 loc) · 1.04 KB
/
test.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import eris
is_connected = 0
is_logged = 0
def connected():
print "connected called"
global is_connected
is_connected = 1
def disconnected():
print "disconnected called"
def disconnecting():
print "disconnecting called"
def failure():
print "failure called"
def status_changed():
print "status_changed called"
def login_success():
print "login_success called"
global is_logged
is_logged = 1
def login_failure():
print "login_failure called"
if __name__ == "__main__":
foo = eris.Connection("foo", "localhost", 6767, 1)
foo.Connected = connected
foo.Disconnected = disconnected
foo.Disconnecting = disconnecting
foo.Failure = failure
foo.StatusChanged = status_changed
foo.connect()
while is_connected == 0:
eris.polldefault.poll()
print "Okay"
acc = eris.Account(foo)
acc.LoginSuccess = login_success
acc.LoginFailure = login_success
acc.login("ajr", "hel")
while is_logged == 0:
eris.polldefault.poll()