From c332732d139eef10d2fe463e0ba2ce4c4e986ce7 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 14 Sep 2011 13:59:25 +0200 Subject: Clean a little bit the poopt module, and fix some comments --- src/pooptmodule.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/pooptmodule.c b/src/pooptmodule.c index b314d21d..b696fe4e 100644 --- a/src/pooptmodule.c +++ b/src/pooptmodule.c @@ -9,8 +9,7 @@ **/ /* This file is a python3 module for poezio, used to replace some time-critical -python functions that are too slow. If compiled, poezio will use this module, -otherwise it will just use the equivalent python functions. */ +python functions that are too slow. */ #define PY_SSIZE_T_CLEAN @@ -30,11 +29,10 @@ PyObject *ErrorObject; will return [(0, 6), (7, 10), (11, 17), (17, 22)], meaning that the lines are "vivent", "les", "frigid" and "aires" */ -PyDoc_STRVAR(poopt_cut_text_doc, "cut_text(width, text)\n\n\nReturn the list of strings, cut according to the given size."); +PyDoc_STRVAR(poopt_cut_text_doc, "cut_text(text, width)\n\n\nReturn a list of two-tuple, the first int is the starting position of the line and the second is its end."); static PyObject *poopt_cut_text(PyObject *self, PyObject *args) { - /* int length; */ unsigned char *buffer; int width; @@ -145,8 +143,6 @@ static PyTypeObject Str_Type = { 0, /*tp_is_gc*/ }; -/* ---------- */ - static PyObject * null_richcompare(PyObject *self, PyObject *other, int op) { @@ -269,11 +265,3 @@ PyInit_poopt(void) Py_XDECREF(m); return NULL; } - -/* /\* test function *\/ */ -/* int main(void) */ -/* { */ -/* char coucou[] = "vive le foutre, le beurre et le caca boudin"; */ - -/* cut_text(coucou, 8); */ -/* } */ -- cgit v1.2.3 From a3959bd12c2324f6e80e75e6f684cae65adaec5e Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 15 Sep 2011 00:15:05 +0200 Subject: Fixes #2244 --- src/room.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/room.py b/src/room.py index 58b96adb..83b00e62 100644 --- a/src/room.py +++ b/src/room.py @@ -99,9 +99,10 @@ class Room(TextBuffer): in the room anymore """ self.log_message(txt, time, nickname) + special_message = False if txt.startswith('/me '): txt = "\x192* \x195" + nickname + ' ' + txt[4:] - nickname = None + special_message = True user = self.get_user_by_name(nickname) if nickname is not None else None if user: user.set_last_talked(datetime.now()) @@ -119,6 +120,9 @@ class Room(TextBuffer): highlight = self.do_highlight(txt, time, nickname) if highlight: nick_color = highlight + if special_message: + txt = '\x195%s' % (txt,) + nickname = None time = time or datetime.now() message = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color, time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\ -- cgit v1.2.3