summaryrefslogtreecommitdiff
path: root/src/client.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-05-18 13:29:02 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-05-18 13:29:02 +0000
commit7ff54100bb0ea9c65f64ca46bf30ef251e7e5345 (patch)
tree8f8a4cb7851fd4c124779e48bbc0a7f96e9b6aa6 /src/client.py
parentd80a16ac9cc73ce95b62a21892e2055a548e0e44 (diff)
downloadpoezio-7ff54100bb0ea9c65f64ca46bf30ef251e7e5345.tar.gz
poezio-7ff54100bb0ea9c65f64ca46bf30ef251e7e5345.tar.bz2
poezio-7ff54100bb0ea9c65f64ca46bf30ef251e7e5345.tar.xz
poezio-7ff54100bb0ea9c65f64ca46bf30ef251e7e5345.zip
pylint cleaning part1
Diffstat (limited to 'src/client.py')
-rw-r--r--src/client.py40
1 files changed, 12 insertions, 28 deletions
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 <http://www.gnu.org/licenses/>.
+"""
+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()