Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
130 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include README.rst LICENSE CHANGES | ||
include dev-requirements.txt .gitignore | ||
include run-tests.py | ||
recursive-include docs * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# _compat.py - Python 2/3 compatibility | ||
|
||
import sys | ||
|
||
PY2 = sys.version_info[0] == 2 | ||
|
||
|
||
if PY2: | ||
text_type = unicode | ||
integer_types = (int, long) | ||
|
||
def iteritems(d): | ||
return d.iteritems() | ||
|
||
def try_encode(chars, encoding='ascii'): | ||
"""Return encoded chars, leave unchanged if encoding fails. | ||
>>> try_encode(u'spam') | ||
'spam' | ||
>>> assert try_encode(u'm\xf8\xf8se') == u'm\xf8\xf8se' | ||
""" | ||
try: | ||
return chars.encode(encoding) | ||
except UnicodeEncodeError: | ||
return chars | ||
|
||
from ConfigParser import SafeConfigParser as ConfigParser | ||
|
||
|
||
else: | ||
text_type = str | ||
integer_types = (int, ) | ||
|
||
def iteritems(d): | ||
return iter(d.items()) | ||
|
||
try_encode = lambda chars, encoding='ascii': chars | ||
|
||
from configparser import ConfigParser | ||
|
||
|
||
def with_metaclass(meta, *bases): | ||
"""From Jinja2 (BSD licensed). | ||
http://github.com/mitsuhiko/jinja2/blob/master/jinja2/_compat.py | ||
""" | ||
class metaclass(meta): | ||
__call__ = type.__call__ | ||
__init__ = type.__init__ | ||
def __new__(cls, name, this_bases, d): | ||
if this_bases is None: | ||
return type.__new__(cls, name, (), d) | ||
return meta(name, bases, d) | ||
return metaclass('temporary_class', None, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[sdist] | ||
formats = zip | ||
|
||
[nosetests] | ||
tests = fileconfig, README.rst | ||
verbosity = 1 | ||
|
Oops, something went wrong.