summaryrefslogtreecommitdiff
path: root/src/client.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-21 01:54:50 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-21 01:54:50 +0000
commitf36fefdce5d9369516a7d88528902b5081080876 (patch)
treee9f017cf7f2f7bd92cc134874cc907fe056d944a /src/client.py
parent6a2917fca8d2c15ac63967a033f001b021623510 (diff)
downloadpoezio-f36fefdce5d9369516a7d88528902b5081080876.tar.gz
poezio-f36fefdce5d9369516a7d88528902b5081080876.tar.bz2
poezio-f36fefdce5d9369516a7d88528902b5081080876.tar.xz
poezio-f36fefdce5d9369516a7d88528902b5081080876.zip
on peut parler, recevoir des messages, rejoindre des salons (/join), changer de tab (/next, /prev), mais ca blink et c'est nul
Diffstat (limited to 'src/client.py')
-rw-r--r--src/client.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/client.py b/src/client.py
index e51c278e..ecbfb1de 100644
--- a/src/client.py
+++ b/src/client.py
@@ -17,17 +17,21 @@
# You should have received a copy of the GNU General Public License
# along with Poezio. If not, see <http://www.gnu.org/licenses/>.
+import sys
+#sys.stderr = open('errors', 'w') # never print anyerror
+#sys.stdout = open('salut', 'w')
+
from connection import Connection
from multiuserchat import MultiUserChat
from config import config
from handler import Handler
from gui import Gui
+from curses import wrapper, initscr
class Client(object):
"""
Main class
- Do what should be done automatically by the Client:
- join the rooms at startup, for example
+ Just read some configuration and instantiate the classes
"""
def __init__(self):
self.handler = Handler()
@@ -35,22 +39,15 @@ class Client(object):
self.resource = config.get('resource')
self.server = config.get('server')
self.connection = Connection(self.server, self.resource)
- self.connection.start()
-
- self.muc = MultiUserChat(self.connection.client)
- self.gui = Gui()
- self.rooms = config.get('rooms').split(':')
-
- import time
- time.sleep(1) # remove
- for room in self.rooms:
- self.handler.emit('join-room', room = room.split('/')[0], nick=room.split('/')[1])
- while 1:
- self.connection.process()
+ self.stdscr = initscr()
+ self.connection.start()
+ self.gui = Gui(self.stdscr, MultiUserChat(self.connection.client))
def main():
client = Client()
+ client.gui.main_loop(client.stdscr)
+ sys.exit()
if __name__ == '__main__':
main()