From 7ff54100bb0ea9c65f64ca46bf30ef251e7e5345 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Tue, 18 May 2010 13:29:02 +0000 Subject: pylint cleaning part1 --- src/client.py | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) (limited to 'src/client.py') diff --git a/src/client.py b/src/client.py index dfc31f3c..3e6d4fef 100644 --- a/src/client.py +++ b/src/client.py @@ -17,6 +17,10 @@ # You should have received a copy of the GNU General Public License # along with Poezio. If not, see . +""" +Starting point of poezio. Launches both the Connection and Gui +""" + import sys # disable any printout (this would mess the display) @@ -26,46 +30,26 @@ sys.stderr = open('errors', 'w') from connection import Connection from multiuserchat import MultiUserChat from config import config -from handler import Handler from gui import Gui from curses import initscr -import curses -import threading from common import exception_handler import signal -signal.signal(signal.SIGINT, signal.SIG_IGN) +signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c sys.excepthook = exception_handler -class Client(object): - """ - Main class - Just read some configuration and instantiate the classes - """ - def __init__(self): - self.handler = Handler() - - self.resource = config.get('resource', 'poezio') - self.server = config.get('server', 'louiz.org') - self.connection = Connection(self.server, self.resource) - self.connection.start() - self.stdscr = initscr() - self.gui = Gui(self.stdscr, MultiUserChat(self.connection.client)) - - def launch(self): - """ - launch the gui - """ - self.gui.main_loop(self.stdscr) - def main(): """ main function """ - client = Client() - client.launch() - sys.exit() + resource = config.get('resource', 'poezio') + server = config.get('server', 'louiz.org') + connection = Connection(server, resource) + connection.start() + stdscr = initscr() + gui = Gui(stdscr, MultiUserChat(connection.client)) + gui.main_loop(stdscr) if __name__ == '__main__': main() -- cgit v1.2.3