-
Notifications
You must be signed in to change notification settings - Fork 91
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
9 changed files
with
63 additions
and
14 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
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,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Backports | ||
""" | ||
# pragma: no-cover | ||
# pylint: disabled | ||
|
||
def cmp_to_key(mycmp): | ||
"""functools.cmp_to_key backport""" | ||
class KeyClass(object): | ||
"""Key class""" | ||
def __init__(self, obj, *args): # pylint: disable=unused-argument | ||
self.obj = obj | ||
def __lt__(self, other): | ||
return mycmp(self.obj, other.obj) < 0 | ||
def __gt__(self, other): | ||
return mycmp(self.obj, other.obj) > 0 | ||
def __eq__(self, other): | ||
return mycmp(self.obj, other.obj) == 0 | ||
def __le__(self, other): | ||
return mycmp(self.obj, other.obj) <= 0 | ||
def __ge__(self, other): | ||
return mycmp(self.obj, other.obj) >= 0 | ||
def __ne__(self, other): | ||
return mycmp(self.obj, other.obj) != 0 | ||
return KeyClass |
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,11 +1,21 @@ | ||
[tox] | ||
envlist = py27,py33,py34,py35,pypy | ||
envlist = py26,py27,py33,py34,py35,pypy | ||
|
||
[testenv:py26] | ||
commands = | ||
{envbindir}/pip install -r dev-requirements.txt | ||
{envpython} setup.py test | ||
|
||
[testenv:py35] | ||
commands = | ||
{envbindir}/pip install -r dev-requirements.txt | ||
{envpython} setup.py test | ||
|
||
[testenv] | ||
commands = | ||
{envbindir}/pip install -r dev-requirements.txt | ||
{envbindir}/pylint guessit | ||
{envpython} setup.py test -a "--doctest-modules --doctest-glob='README.rst'" | ||
{envpython} setup.py test | ||
|
||
[pep8] | ||
max-line-length = 119 |