* Rearrange imports

* Just import getwriter from codecs
This commit is contained in:
Stefan Ritter 2011-08-25 21:03:52 +02:00
parent 25e7cc7a09
commit 3853641e80

View File

@ -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("^-.*$")