Esempio n. 1
0
# === internal module ===
import threading
import os
# === external module ===
from twisted.internet import reactor
# === project module === 
from configLoader import ConfigLoader
from ui import TtvChatAppUI
from bot import IrcBotFactory


# load ini
print 'loading setting....'
p = ConfigLoader()
settings = p.load('settings.ini')

# init UI thread
print 'preparing UI thread....'
class uiThread(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
        self.appUI = TtvChatAppUI(None)
        self.appUI.title('moo Chat')
        self.start()
        
    def run(self):
        print '\n===UI thread online===\n'
        # block here
        self.appUI.mainloop()
        # end the main thread when UI is closed