callbacks update, bug fixes

This commit is contained in:
ingvar1995 2016-02-23 00:18:58 +03:00
parent e0dd55d395
commit 18e027ffd9
4 changed files with 17 additions and 12 deletions

View file

@ -1,14 +1,20 @@
# TODO: add all callbacks (use wrappers)
# TODO: add all callbacks (replace test callbacks and use wrappers)
def status(a, b, c):
def self_connection_status(a, b, c):
print 'WOW, it works!'
print str(b)
print 'Status: ', str(b)
def friend_status(a, b, c, d, e):
print 'Friend connected! Friend number: ' + str(c)
def friend_status(a, b, c, d):
print "Friend connected! Friend's data: ", str(a), str(b), str(c)
def message(a, b, c, d, e, f):
print 'Message: ', str(d)
def friend_message(a, b, c, d, e, f):
print 'Message: ', unicode(d, "utf-8")
def init_callbacks(tox):
tox.callback_friend_status(friend_status, 0)
tox.callback_friend_message(friend_message, 0)
tox.callback_self_connection_status(self_connection_status, 0)