From 6c94f611a5c510435de3961550c2f95b5c7de944 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Sun, 31 Jan 2010 14:23:14 +0000 Subject: test --- src/client.py | 7 ------- src/config.py | 7 ++----- src/gui.py | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client.py b/src/client.py index 263ed08f..a224bc9c 100644 --- a/src/client.py +++ b/src/client.py @@ -17,13 +17,6 @@ # You should have received a copy of the GNU General Public License # along with Poezio. If not, see . -from gettext import (bindtextdomain, textdomain, bind_textdomain_codeset, - gettext as _) - -bindtextdomain('poezio') -textdomain('poezio') -bind_textdomain_codeset('poezio', 'UTF-8') - import sys from connection import Connection from multiuserchat import MultiUserChat diff --git a/src/config.py b/src/config.py index 4a507522..4d751072 100644 --- a/src/config.py +++ b/src/config.py @@ -84,10 +84,7 @@ if not CONFIG_HOME: CONFIG_HOME = environ.get('HOME')+'/.config/' CONFIG_PATH = CONFIG_HOME + 'poezio/' -try: - makedirs(CONFIG_PATH) - copy2('../data/default_config.cfg', CONFIG_PATH+'poezio.cfg') -except: - pass +makedirs(CONFIG_PATH) +copy2('../data/default_config.cfg', CONFIG_PATH+'poezio.cfg') config = Config(CONFIG_PATH+'poezio.cfg') diff --git a/src/gui.py b/src/gui.py index e2721ffa..6b557575 100644 --- a/src/gui.py +++ b/src/gui.py @@ -20,6 +20,10 @@ from gettext import (bindtextdomain, textdomain, bind_textdomain_codeset, gettext as _) +bindtextdomain('poezio') +textdomain('poezio') +bind_textdomain_codeset('poezio', 'utf-8') + import locale locale.setlocale(locale.LC_ALL, '') import sys @@ -75,8 +79,12 @@ class Room(object): def add_info(self, info): """ info, like join/quit/status messages""" - self.lines.append((datetime.now(), info.encode('utf-8'))) - return info.encode('utf-8') + try: + self.lines.append((datetime.now(), info.encode('utf-8'))) + return info.encode('utf-8') + except: # I JUST FUCKING HATE THIS .encode.decode.shit !!! + self.lines.append((datetime.now(), info)) + return info def get_user_by_name(self, nick): for user in self.users: @@ -162,7 +170,7 @@ class Gui(object): 'next': (self.rotate_rooms_left, _('Usage: /next\nNext: Go to the next room.')), 'prev': (self.rotate_rooms_right, _('Usage: /prev\nPrev: Go to the previous room.')), 'part': (self.command_part, _('Usage: /part [message]\nPart: disconnect from a room. You can specify an optional message.')), - 'show': (self.command_show, _('Usage: /show [status]\nShow: Change your availability and (optionaly) your status. The argument is one of "avail, available, ok, here, chat, away, afk, dnd, busy, xa" and the optional [message] argument will be your status message')), + 'show': (self.command_show, _(u'Usage: /show [status]\nShow: Change your availability and (optionaly) your status. The argument is one of "avail, available, ok, here, chat, away, afk, dnd, busy, xa" and the optional [message] argument will be your status message')), 'away': (self.command_away, _('Usage: /away [message]\nAway: Sets your availability to away and (optional) sets your status message. This is equivalent to "/show away [message]"')), 'busy': (self.command_busy, _('Usage: /busy [message]\nBusy: Sets your availability to busy and (optional) sets your status message. This is equivalent to "/show busy [message]"')), 'avail': (self.command_avail, _('Usage: /avail [message]\nAvail: Sets your availability to available and (optional) sets your status message. This is equivalent to "/show available [message]"')), @@ -354,6 +362,7 @@ class Gui(object): msg = self.commands[args[0]][1] else: msg = _('Unknown command: %s') % args[0] +# open('fion', 'w').write(msg) room.add_info(msg) self.window.text_win.add_line(room, (datetime.now(), msg)) self.window.text_win.refresh(room.name) -- cgit v1.2.3