summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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)