]> jfr.im git - irc/weechat/qweechat.git/blobdiff - src/qweechat/weechat/color.py
Move comments with description of python file to top of files
[irc/weechat/qweechat.git] / src / qweechat / weechat / color.py
index f2923ee4def7d54e26a5fb62e634273130bfe06b..09195a0ea049ae926f262acfd042c9a85238be36 100644 (file)
@@ -1,7 +1,9 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2011 Sebastien Helleu <flashcode@flashtux.org>
+# color.py - remove/replace colors in WeeChat strings
+#
+# Copyright (C) 2011-2013 Sebastien Helleu <flashcode@flashtux.org>
 #
 # This file is part of QWeeChat, a Qt remote GUI for WeeChat.
 #
 # along with QWeeChat.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-#
-# Remove or replace colors in WeeChat strings.
-#
-
 import re
 
 RE_COLOR_ATTRS = r'[*!/_|]*'
@@ -163,8 +161,8 @@ class Color():
         else:
             return RE_COLOR.sub(self._convert_color, text)
 
-    def remove(self, text):
-        """Remove colors in a WeeChat string."""
-        if not text:
-            return ''
-        return re.sub(RE_COLOR, '', text)
+def remove(text):
+    """Remove colors in a WeeChat string."""
+    if not text:
+        return ''
+    return re.sub(RE_COLOR, '', text)