Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Revert "Work around incomplete reads at citybik.es networks endpoint"
Browse files Browse the repository at this point in the history
This reverts commit c7df05a.

Never mind, many of the station lists are long enough too that they get
cut and can't really ship those.
  • Loading branch information
otsaloma committed Jul 7, 2018
1 parent 94e7202 commit 0a5c757
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5,770 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ install:
cp providers/[!_]*.py $(DATADIR)/providers
cp providers/*.qml $(DATADIR)/providers
cp providers/README.md $(DATADIR)/providers
mkdir -p $(DATADIR)/providers/citybikes
cp providers/citybikes/*.json $(DATADIR)/providers/citybikes
@echo "Installing translations..."
$(foreach lang,$(LANGS),$(call install-translation,$(lang)))
@echo "Installing desktop file..."
Expand Down
9 changes: 3 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Pan Bikes 1.2.1
===============
Pan Bikes 1.2.1/1.3
===================

* [x] Work around citybik.es network list not being readable from the
server by shipping the list of networks along with Pan Bikes
* [x] Add missing QtLocation and HERE plugin dependencies to RPM spec
file (#1)
* [x] Add missing QtLocation and HERE plugin dependencies to RPM spec file (#1)
10 changes: 2 additions & 8 deletions providers/citybikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@
https://api.citybik.es/v2/
"""

import os
import pan
import re

directory = os.path.abspath(os.path.dirname(__file__))

def list_networks():
"""Return a list of supported city bike networks."""
# XXX: Work around incomplete reads at the networks endpoint.
fname = os.path.join(directory, "citybikes", "networks.json")
networks = pan.util.read_json(fname)
# url = "https://api.citybik.es/v2/networks?fields=id,location,name"
# networks = pan.http.get_json(url)
url = "https://api.citybik.es/v2/networks?fields=id,location,name"
networks = pan.http.get_json(url)
networks = pan.AttrDict(networks)
return [dict(
city=network.location.city,
Expand Down
Loading

0 comments on commit 0a5c757

Please sign in to comment.