use configparser backport to support python2.6 again
This commit is contained in:
parent
988d2032c5
commit
f9133b984e
@ -5,6 +5,7 @@ from __future__ import print_function
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import binascii
|
||||
|
||||
import thread
|
||||
import threading
|
||||
@ -15,7 +16,7 @@ import smtplib
|
||||
import httplib
|
||||
import urlparse
|
||||
|
||||
from ConfigParser import ConfigParser
|
||||
from configparser import ConfigParser
|
||||
|
||||
try:
|
||||
import uwsgi
|
||||
@ -29,7 +30,7 @@ class Config:
|
||||
|
||||
default = [
|
||||
"[general]",
|
||||
"dbpath = /tmp/isso.db", "secretkey = %r" % os.urandom(24),
|
||||
"dbpath = /tmp/isso.db", "secretkey = %r" % binascii.b2a_hex(os.urandom(24)),
|
||||
"host = http://localhost:8080/", "passphrase = p@$$w0rd",
|
||||
"max-age = 900",
|
||||
"[server]",
|
||||
@ -48,7 +49,7 @@ class Config:
|
||||
def load(cls, configfile):
|
||||
|
||||
rv = ConfigParser(allow_no_value=True)
|
||||
rv.readfp(io.StringIO(u'\n'.join(Config.default)))
|
||||
rv.read_file(io.StringIO(u'\n'.join(Config.default)))
|
||||
|
||||
if configfile:
|
||||
rv.read(configfile)
|
||||
|
@ -15,8 +15,8 @@ from werkzeug.exceptions import abort, BadRequest
|
||||
from isso import utils, notify, db
|
||||
from isso.crypto import pbkdf2
|
||||
|
||||
FIELDS = {'id', 'parent', 'text', 'author', 'website', 'email', 'mode', 'created',
|
||||
'modified', 'likes', 'dislikes', 'hash'}
|
||||
FIELDS = set(['id', 'parent', 'text', 'author', 'website', 'email', 'mode',
|
||||
'created', 'modified', 'likes', 'dislikes', 'hash'])
|
||||
|
||||
|
||||
class requires:
|
||||
|
2
setup.py
2
setup.py
@ -8,7 +8,7 @@ from setuptools import setup, find_packages
|
||||
requires = ['Jinja2>=2.7', 'werkzeug>=0.9', 'itsdangerous', 'misaka', 'html5lib']
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
requires += ['ipaddress']
|
||||
requires += ['ipaddress', 'configparser']
|
||||
|
||||
setup(
|
||||
name='isso',
|
||||
|
Loading…
Reference in New Issue
Block a user