summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-31 14:23:14 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-31 14:23:14 +0000
commit6c94f611a5c510435de3961550c2f95b5c7de944 (patch)
treea01509c94d62285a697cf47e084caae7c6d660d4 /src
parent9faeb0674c012383a2d01a9c17d97f94cc5a5897 (diff)
downloadpoezio-6c94f611a5c510435de3961550c2f95b5c7de944.tar.gz
poezio-6c94f611a5c510435de3961550c2f95b5c7de944.tar.bz2
poezio-6c94f611a5c510435de3961550c2f95b5c7de944.tar.xz
poezio-6c94f611a5c510435de3961550c2f95b5c7de944.zip
test
Diffstat (limited to 'src')
-rw-r--r--src/client.py7
-rw-r--r--src/config.py7
-rw-r--r--src/gui.py15
3 files changed, 14 insertions, 15 deletions
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 <http://www.gnu.org/licenses/>.
-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 <availability> [status]\nShow: Change your availability and (optionaly) your status. The <availability> 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 <availability> [status]\nShow: Change your availability and (optionaly) your status. The <availability> 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)