Skip to content

Commit

Permalink
Merge 19f14dc into 484ba1c
Browse files Browse the repository at this point in the history
  • Loading branch information
hfaran committed Feb 16, 2014
2 parents 484ba1c + 19f14dc commit 93ff61a
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 19 deletions.
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,6 +1,7 @@
language: python
python:
- "2.7"
- "3.3"
install:
- "pip install -r requirements.txt --use-mirrors"
- "pip install pytest"
Expand Down
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -23,8 +23,6 @@ Some of the key features the included modules provide:

# Dependencies

*Python2.7 is the only supported version (as you might suspect).*

These dependencies can be satisfied by running `pip install -r requirements.txt`

* tornado
Expand Down
2 changes: 0 additions & 2 deletions README.rst
Expand Up @@ -38,8 +38,6 @@ being said, use it at your own risk.*\
Dependencies
============

*Python2.7 is the only supported version (as you might suspect).*

These dependencies can be satisfied by running
``pip install -r requirements.txt``

Expand Down
5 changes: 0 additions & 5 deletions setup.py
Expand Up @@ -10,11 +10,6 @@
import tornado_json


if not sys.version_info[:2] == (2, 7):
print "Sorry, only Python2.7 is supported."
exit()


def read(filename):
"""Read and return `filename` in root dir of project and return string"""
return codecs.open(os.path.join(__DIR__, filename), 'r').read()
Expand Down
2 changes: 1 addition & 1 deletion tornado_json/__init__.py
Expand Up @@ -5,4 +5,4 @@
# Alternatively, just put the version in a text file or something to avoid
# this.

__version__ = '0.11'
__version__ = '0.12'
2 changes: 1 addition & 1 deletion tornado_json/api_doc_gen.py
Expand Up @@ -63,7 +63,7 @@ def api_doc_gen(routes):
```
""".format(json.dumps(rh.apid[method]["output_example"], indent=4))
if rh.apid[method].get("output_example") else "",
) for method in rh.apid.keys()
) for method in list(rh.apid.keys())
]
)
)
Expand Down
2 changes: 1 addition & 1 deletion tornado_json/application.py
Expand Up @@ -22,7 +22,7 @@ def __init__(self, routes, settings, db_conn=None):
api_doc_gen(routes)

# Unless gzip was specifically set to False in settings, enable it
if "gzip" not in settings.keys():
if "gzip" not in list(settings.keys()):
settings["gzip"] = True

tornado.web.Application.__init__(
Expand Down
2 changes: 1 addition & 1 deletion tornado_json/requesthandlers.py
Expand Up @@ -63,7 +63,7 @@ def write_error(self, status_code, **kwargs):
self.clear()

# If exc_info is not in kwargs, something is very fubar
if not "exc_info" in kwargs.keys():
if not "exc_info" in list(kwargs.keys()):
logging.error("exc_info not provided")
self.set_status(500)
self.error(message="Internal Server Error", code=500)
Expand Down
8 changes: 3 additions & 5 deletions tornado_json/routes.py
Expand Up @@ -4,6 +4,7 @@
import inspect
import types
from itertools import chain
from functools import reduce


def get_routes(package):
Expand Down Expand Up @@ -98,10 +99,7 @@ def yield_args(module, cls_name, method_name):
# method = getattr(getattr(module, cls_name), method_name)
wrapped_method = reduce(getattr, [module, cls_name, method_name])
method = extract_method(wrapped_method)
return filter(
lambda a: a not in ["self"],
inspect.getargspec(method).args
)
return [a for a in inspect.getargspec(method).args if a not in ["self"]]

if not custom_routes:
custom_routes = []
Expand Down Expand Up @@ -138,7 +136,7 @@ def yield_args(module, cls_name, method_name):
] if has_method(module, k, method_name)
]))
# foreach classname, pyclbr.Class in rhs
for k, v in rhs.iteritems()
for k, v in rhs.items()
# Only add the pair to auto_routes if:
# * the superclass is in the list of supers we want
# * the requesthandler isn't already paired in custom_routes
Expand Down
2 changes: 1 addition & 1 deletion tornado_json/test/test_tornado_json.py
Expand Up @@ -9,7 +9,7 @@
from tornado_json import jsend
sys.path.append('demos/helloworld')
import helloworld
except ImportError:
except ImportError as e:
print("Please run `py.test` from the root project directory")
exit(1)

Expand Down

0 comments on commit 93ff61a

Please sign in to comment.