updates of main.py, util and bootstrap

This commit is contained in:
ingvar1995 2016-02-20 14:50:49 +03:00
parent fe43a4d03d
commit a9837a80f4
3 changed files with 12 additions and 6 deletions

View file

@ -5,6 +5,7 @@ from profile import Profile
import sys
from PySide import QtCore, QtGui
from tox import Tox
from bootstrap import node_generator
class login(object):
@ -34,6 +35,10 @@ def status(a, b, c):
print str(b)
def friend_status(*args):
print 'Friend connected! Friend number: ' + str(args[1])
def main():
"""
main function of app. loads loginscreen if needed and starts mainscreen
@ -72,8 +77,12 @@ def main():
ms = MainWindow()
# creating tox instance
tox = Tox(data, settings)
# bootstrap
for data in node_generator():
tox.bootstrap(*data)
# TODO: set callbacks
#tox.callback_self_connection_status(status, 0)
tox.callback_self_connection_status(status, 0)
tox.callback_friend_connection_status(friend_status, 0)
# starting thread for tox iterate
mainloop = ToxIterateThread(tox)
mainloop.start()