diff options
author | Stefan Ritter <xeno@thehappy.de> | 2011-03-23 22:48:21 +0100 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2011-03-23 22:48:21 +0100 |
commit | f44fae97710483f71bb1cbdcbe5bb41656660486 (patch) | |
tree | 70ca039e95f722e7b4a61242d02f889c4793f3a6 | |
parent | f9bc02e1c0d8aa4dc68221259ba50265c8a6c185 (diff) |
Python3 compatibility
-rwxr-xr-x | blogthon.cgi | 6 | ||||
-rw-r--r-- | plugins/plugin_example.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/blogthon.cgi b/blogthon.cgi index 1151890..d176c6c 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -18,7 +18,7 @@ import sys import time import locale import re -import ConfigParser +import configparser from cgi import FieldStorage from smtplib import SMTP from hashlib import md5 @@ -70,7 +70,7 @@ def document_header(string): print("<rss version=\"2.0\">") # Parse configuration -configuration = ConfigParser.SafeConfigParser() +configuration = configparser.SafeConfigParser() for config in ["../blogthonrc", "../.blogthonrc", "configuration"]: if os.path.exists(config): @@ -105,7 +105,7 @@ try: mail_to = configuration.get("smtp", "mail_to") smtp_host = configuration.get("smtp", "smtp_host") feed_preview = configuration.get("feed", "feed_preview") -except ConfigParser.Error, error: +except configparser.Error as error: errorpage(str(error)) if not re.match("^http:\/\/.*$", blog_url): diff --git a/plugins/plugin_example.py b/plugins/plugin_example.py index 695af52..9361921 100644 --- a/plugins/plugin_example.py +++ b/plugins/plugin_example.py @@ -10,7 +10,7 @@ # Author: Stefan Ritter <xeno@thehappy.de> # Description: Example plugin -print ' <p style="position: absolute; top: 0px; right: 0px; color: #666666; font-size: 10px;">' -print ' This blog is powered by Blogthon! ' -print ' </p>' -print '' +print(" <p style=\"position: absolute; top: 0px; right: 0px; color: #666666; font-size: 10px;\">") +print(" This blog is powered by Blogthon! ") +print(" </p>") +print("") |