toxygen/src/callbacks.py

26 lines
632 B
Python
Raw Normal View History

2016-02-22 21:18:58 +00:00
# TODO: add all callbacks (replace test callbacks and use wrappers)
2016-02-22 15:55:04 +00:00
2016-02-22 21:18:58 +00:00
def self_connection_status(a, b, c):
2016-02-22 15:55:04 +00:00
print 'WOW, it works!'
2016-02-22 21:18:58 +00:00
print 'Status: ', str(b)
2016-02-22 15:55:04 +00:00
2016-02-22 21:18:58 +00:00
def friend_status(a, b, c, d):
print "Friend connected! Friend's data: ", str(a), str(b), str(c)
2016-02-22 15:55:04 +00:00
2016-02-22 21:18:58 +00:00
def friend_message(a, b, c, d, e, f):
2016-02-23 11:11:00 +00:00
print 'Message: ', str(d)
2016-02-22 21:18:58 +00:00
2016-02-23 11:11:00 +00:00
def init_callbacks(tox, window):
"""
:param tox: tox instance
:param window: main window
:return: None
"""
2016-02-22 21:18:58 +00:00
tox.callback_friend_status(friend_status, 0)
tox.callback_friend_message(friend_message, 0)
tox.callback_self_connection_status(self_connection_status, 0)