]> jfr.im git - irc/weechat/scripts.git/commitdiff
upside_down.py 0.3.1: port to python3
authorFriedrich Delgado <redacted>
Mon, 14 Mar 2022 08:13:21 +0000 (09:13 +0100)
committerSébastien Helleu <redacted>
Sat, 19 Mar 2022 08:59:45 +0000 (09:59 +0100)
python/upside_down.py

index e07a7bf561910b79913a65bfe7340d7c9ccfc423..74adbe6df72a5684f3cce527d9c0a73baa740f2e 100644 (file)
 #
 #
 #
-# USAGE: Bind a key to command /flip . Then write some text at input line 
+# USAGE: Bind a key to command /flip . Then write some text at input line
 # press your key to transform it to upside down.
 
 #
 # (this script requires WeeChat 0.3.0 or newer)
 #
 # History:
+# 2022-03-14, TauPan <taupan@gmail.com>
+#   version 0.3.1: port to python3
 # 2010-01-14, xt
 #   version 0.3: steal more chars from m4v
 # 2010-01-06, xt <xt@bash.no>
@@ -36,7 +38,7 @@ import re
 
 SCRIPT_NAME    = "upside_down"
 SCRIPT_AUTHOR  = "xt <xt@bash.no>"
-SCRIPT_VERSION = "0.3"
+SCRIPT_VERSION = "0.3.1"
 SCRIPT_LICENSE = "GPL3"
 SCRIPT_DESC    = "Replaces text you write with upside down text"
 
@@ -104,7 +106,7 @@ replacements = {
 
 if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
                     SCRIPT_DESC, "", ""):
-    for option, default_value in settings.iteritems():
+    for option, default_value in settings.items():
         if not w.config_is_set_plugin(option):
             w.config_set_plugin(option, default_value)
     w.hook_command("flip",
@@ -125,6 +127,5 @@ def flip_cmd_cb(data, buffer, args):
         if char in replacements:
             char = replacements[char]
         outstring += char
-    outstring = outstring.encode('UTF-8')
     w.buffer_set(w.current_buffer(), 'input', outstring)
     return w.WEECHAT_RC_OK