Skip to content

Commit

Permalink
Fix: cleanup LGTM alerts and README (#3)
Browse files Browse the repository at this point in the history
* Feat: add LGTM badges to README

* Fixed LGTM alerts

* Update README
  • Loading branch information
devadvance authored and Tyler Green committed Jun 19, 2019
1 parent 486f693 commit 4af762d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gtfs-realtime-translators

[![Build Status](https://travis-ci.org/Intersection/gtfs-realtime-translators.svg?branch=master)](https://travis-ci.org/Intersection/gtfs-realtime-translators)
[![Build Status](https://travis-ci.org/Intersection/gtfs-realtime-translators.svg?branch=master)](https://travis-ci.org/Intersection/gtfs-realtime-translators) [![Total alerts](https://img.shields.io/lgtm/alerts/g/Intersection/gtfs-realtime-translators.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Intersection/gtfs-realtime-translators/alerts/) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Intersection/gtfs-realtime-translators.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Intersection/gtfs-realtime-translators/context:python)

`gtfs-realtime-translators` translates custom arrivals formats to GTFS-realtime. It uses the Google [`gtfs-realtime-bindings`](https://github.com/google/gtfs-realtime-bindings/tree/master/python) for Python, supplemented by Intersection extensions.

Expand Down Expand Up @@ -88,5 +88,5 @@ from google.transit import gtfs_realtime_pb2 as gtfs__realtime__pb2
```
pip install -r requirements.txt
pip install -e .
py.test
pytest
```
2 changes: 1 addition & 1 deletion gtfs_realtime_translators/translators/la_metro.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def calculate_trip_id(cls, trip_id):
"""
try:
return trip_id.split('_')[0]
except:
except Exception:
return trip_id

@classmethod
Expand Down
3 changes: 1 addition & 2 deletions gtfs_realtime_translators/translators/septa_regional_rail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import re
import math
import copy

import pendulum
Expand Down Expand Up @@ -34,7 +33,7 @@ def __init__(self, data, **kwargs):
root_key = next(iter([*data]), None)

if root_key is None:
raise 'unexpected format'
raise ValueError('root_key: unexpected format')

arrivals_body = data[root_key]
northbound = [ direction_list['Northbound'] for direction_list in arrivals_body if [*direction_list][0] == 'Northbound' ][0]
Expand Down

0 comments on commit 4af762d

Please sign in to comment.