diff options
author | Stefan Ritter <xeno@thehappy.de> | 2011-08-25 21:03:52 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2011-08-25 21:03:52 +0200 |
commit | 3853641e804a68c7b75bd644e7ce835e203366f9 (patch) | |
tree | 508c3bcee947df0c582efa739a1927d11c1d1c89 /blogthon.cgi | |
parent | 25e7cc7a0964b0419b639faaade6580caf5fd64a (diff) |
* Rearrange imports
* Just import getwriter from codecs
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-x | blogthon.cgi | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/blogthon.cgi b/blogthon.cgi index 2457273..a8e3f3f 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -18,11 +18,16 @@ import sys import time import locale import re -import codecs +from cgi import FieldStorage +from smtplib import SMTP +from hashlib import md5 +from glob import glob +from random import randint +from codecs import getwriter # print() will output ascii, but we want utf-8 (python3) try: - sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) + sys.stdout = getwriter('utf8')(sys.stdout.buffer) utf8 = True except: utf8 = False @@ -33,12 +38,6 @@ try: except ImportError: import ConfigParser as configparser -from cgi import FieldStorage -from smtplib import SMTP -from hashlib import md5 -from glob import glob -from random import randint - # A wonderful place for doing some regexp ;) no_break = re.compile("^\s*(<ul|</ul>|<li|</li>|<ol|</ol>|<table|</table>|<tr|</tr>|<td|</td>|<th|</th>|<p|</p>).*$") line_start_hyphen = re.compile("^-.*$") |