Skip to content

Commit

Permalink
Update pylint + deal with new lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ihodes committed Dec 18, 2015
1 parent 7957580 commit e880045
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 21 deletions.
4 changes: 3 additions & 1 deletion cycledash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from flask import Flask, jsonify, request, make_response, current_app
import flask.json
from flask_sqlalchemy import SQLAlchemy
from flask.ext import restful, login, bcrypt
import flask_restful as restful
import flast_login as login
import flask_bcrypt as bcrypt
import humanize
import logging
import sys
Expand Down
12 changes: 6 additions & 6 deletions cycledash/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import OrderedDict
from flask import request
import flask.ext.restful
from flask.ext.login import current_user
import flask_restful
from flask_login import current_user
import functools
import voluptuous

Expand All @@ -10,7 +10,7 @@
from cycledash.helpers import prepare_request_data, camelcase_dict


class Resource(flask.ext.restful.Resource, object):
class Resource(flask_restful.Resource, object):
"""Extends Resource by adding an authentication check for basic auth or
valid session cokie.
"""
Expand All @@ -33,7 +33,7 @@ def dispatch_request(self, *args, **kwargs):
authorized = True
if not authorized:
auth_msg = 'Correct username/password required.'
return flask.ext.restful.abort(401, message=auth_msg)
return flask_restful.abort(401, message=auth_msg)
return super(Resource, self).dispatch_request(*args, **kwargs)


Expand Down Expand Up @@ -88,12 +88,12 @@ def decorator(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
if not (request.json or request.data or request.form):
flask.ext.restful.abort(400, message='Validation error.',
flask_restful.abort(400, message='Validation error.',
errors=['No data provided.'])
try:
data = schema(prepare_request_data(request))
except voluptuous.MultipleInvalid as err:
flask.ext.restful.abort(400,
flask_restful.abort(400,
message='Validation error.',
errors=[str(e) for e in err.errors])
setattr(request, 'validated_body', data)
Expand Down
2 changes: 1 addition & 1 deletion cycledash/api/bams.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines the API for BAMs."""
from flask import request
from flask.ext.restful import abort, fields
from flask_restful import abort, fields
from sqlalchemy import select, desc
import voluptuous
from voluptuous import Schema, Required, Any, Exclusive, Coerce
Expand Down
4 changes: 2 additions & 2 deletions cycledash/api/comments.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""API for user comments."""
from collections import defaultdict
from flask import jsonify, request
from flask.ext.restful import abort, fields
from flask.ext.login import current_user
from flask_restful import abort, fields
from flask_login import current_user
from sqlalchemy import select, func, desc
from voluptuous import Any, Required, Coerce, Schema

Expand Down
2 changes: 1 addition & 1 deletion cycledash/api/genotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import copy
import json
from flask import request
import flask.ext.restful as restful
import flask_restful as restful
from plone.memoize import forever
from sqlalchemy import (select, func, types, cast, join, outerjoin, asc, desc,
and_, Integer, Float, String, distinct)
Expand Down
2 changes: 1 addition & 1 deletion cycledash/api/projects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Defines the API for Projects."""
from flask import request, redirect, jsonify, url_for, render_template
from flask.ext.restful import fields, abort
from flask_restful import fields, abort
from sqlalchemy import exc, select, func, desc
import voluptuous
from voluptuous import Schema, Required, Any
Expand Down
2 changes: 1 addition & 1 deletion cycledash/api/runs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
from flask import request
from flask.ext.restful import abort, fields
from flask_restful import abort, fields
from sqlalchemy import select, desc, func
import voluptuous
from voluptuous import Schema, Any, Required, Exclusive, Coerce
Expand Down
2 changes: 1 addition & 1 deletion cycledash/api/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Methods for working with Celery task states."""
from collections import defaultdict
from sqlalchemy import select
from flask.ext.restful import abort, fields
from flask_restful import abort, fields
from voluptuous import Schema, Any

from common.helpers import tables
Expand Down
2 changes: 1 addition & 1 deletion cycledash/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module to manage user authentication and identification."""
from flask import request, redirect, render_template
from flask.ext.login import login_user, logout_user
from flask_login import login_user, logout_user
from sqlalchemy import exc
import voluptuous
import base64
Expand Down
4 changes: 2 additions & 2 deletions cycledash/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from common.helpers import tables, to_epoch

from flask import jsonify, request, url_for, redirect
import flask.ext.restful, flask.ext.restful.fields
import flask_restful, flask_restful.fields
import voluptuous
from werkzeug.utils import secure_filename

Expand Down Expand Up @@ -188,7 +188,7 @@ def abort_if_none_for(obj_name):
def abort_if_none(obj, obj_id):
"""Abort request with a 404 if object is None."""
if obj is None:
flask.ext.restful.abort(
flask_restful.abort(
404,
message='No {} with id={} found.'.format(obj_name, obj_id))
else:
Expand Down
2 changes: 1 addition & 1 deletion cycledash/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import tempfile
from flask import request, redirect, render_template, send_file, Response
from flask.ext.login import login_required
from flask_login import login_required
from sqlalchemy import select, desc, exc
import voluptuous

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ requests==2.3.0
voluptuous==0.8.7
wsgiref==0.1.2
psycopg2==2.5.4
pylint==1.4.1
pylint==1.5.0
humanize==0.5.1
varcode==0.3.11
mock==1.0.1
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_authentication.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests to make sure authentication is present + working."""


from flask.ext.login import login_user
from flask_login import login_user
import mock
import nose
import nose.tools as asserts
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Test rendered views of Cycledash."""
from flask.ext.login import login_user
from flask_login import login_user
import mock
import nose
import nose.tools as asserts
Expand Down

0 comments on commit e880045

Please sign in to comment.