Skip to content

Commit

Permalink
Fixed Flake8 For Submodules
Browse files Browse the repository at this point in the history
This patch ensures that flake8 is applied to sub-modules (namely ui) as
well to have the checks included into Travis builds.
  • Loading branch information
lkiesow committed Apr 15, 2017
1 parent f8d911b commit d19c77e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:

script:
- coverage run --source=pyca --omit='*.html' -m unittest discover -s tests
- flake8 tests/*.py pyca/*.py
- flake8 $(find . -name '*.py')

after_success:
- coveralls
14 changes: 6 additions & 8 deletions pyca/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simple UI telling about the current state of the capture agent.
'''
from pyca.config import config
from pyca.db import get_session, Status, UpcomingEvent, RecordedEvent
from pyca.db import get_session, UpcomingEvent, RecordedEvent
from pyca.db import Service, ServiceStatus
from pyca.utils import get_service_status

Expand All @@ -25,9 +25,9 @@ def requires_auth(f):
@wraps(f)
def decorated(*args, **kwargs):
auth = request.authorization
if config()['ui']['password'] and not request.authorization \
or request.authorization.username != config()['ui']['username'] \
or request.authorization.password != config()['ui']['password']:
if config()['ui']['password'] and not auth \
or auth.username != config()['ui']['username'] \
or auth.password != config()['ui']['password']:
return Response('pyCA', 401,
{'WWW-Authenticate': 'Basic realm="pyCA Login"'})
return f(*args, **kwargs)
Expand Down Expand Up @@ -61,10 +61,8 @@ def home():
recorded_events = db.query(RecordedEvent)\
.order_by(RecordedEvent.start.desc())\
.limit(limit_processed)
recording = get_service_status(Service.CAPTURE) \
== ServiceStatus.BUSY
uploading = get_service_status(Service.INGEST) \
== ServiceStatus.BUSY
recording = get_service_status(Service.CAPTURE) == ServiceStatus.BUSY
uploading = get_service_status(Service.INGEST) == ServiceStatus.BUSY
processed = db.query(RecordedEvent).count()
upcoming = db.query(UpcomingEvent).count()

Expand Down

0 comments on commit d19c77e

Please sign in to comment.