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

Commit

Permalink
Use data, not config directory for tilesources and geocoders.
Browse files Browse the repository at this point in the history
Duh.
  • Loading branch information
otsaloma committed Apr 12, 2014
1 parent dd8f302 commit 39eba3e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Poor Maps 0.2
[X] New icon (now matches in-app position icon)
[X] Add framework to support pluggable geocoders
[X] Add MapQuest Nominatim geocoder
[X] Load user's own tilesources and geocoders from
$HOME/.local/share/harbour-poor-maps instead of
$HOME/.config/harbour-poor-maps
[X] Allow landscape for menu pages (the map page remains portrait only
due to some QtLocation problem rotating gestures)
[X] Bump required PyOtherSide version to 1.2 (included in Sailfish OS
Expand Down
2 changes: 1 addition & 1 deletion poor/geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _init_provider(self, path):
def _load_attributes(self, id):
"""Read and return attributes from JSON file."""
leaf = os.path.join("geocoders", "{}.json".format(id))
path = os.path.join(poor.CONFIG_HOME_DIR, leaf)
path = os.path.join(poor.DATA_HOME_DIR, leaf)
if not os.path.isfile(path):
path = os.path.join(poor.DATA_DIR, leaf)
with open(path, "r", encoding="utf_8") as f:
Expand Down
2 changes: 1 addition & 1 deletion poor/tilesource.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _init_http_connections(self):
def _load_attributes(self, id):
"""Read and return attributes from JSON file."""
leaf = os.path.join("tilesources", "{}.json".format(id))
path = os.path.join(poor.CONFIG_HOME_DIR, leaf)
path = os.path.join(poor.DATA_HOME_DIR, leaf)
if not os.path.isfile(path):
path = os.path.join(poor.DATA_DIR, leaf)
with open(path, "r", encoding="utf_8") as f:
Expand Down
4 changes: 2 additions & 2 deletions poor/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def format_distance(distance, n, units="km"):
def get_geocoders():
"""Return a list of dictionaries of geocoder attributes."""
geocoders = []
for parent in (poor.CONFIG_HOME_DIR, poor.DATA_DIR):
for parent in (poor.DATA_HOME_DIR, poor.DATA_DIR):
for path in glob.glob("{}/geocoders/*.json".format(parent)):
pid = os.path.basename(path).replace(".json", "")
# Local definitions override global ones.
Expand All @@ -129,7 +129,7 @@ def get_geocoders():
def get_tilesources():
"""Return a list of dictionaries of tilesource attributes."""
tilesources = []
for parent in (poor.CONFIG_HOME_DIR, poor.DATA_DIR):
for parent in (poor.DATA_HOME_DIR, poor.DATA_DIR):
for path in glob.glob("{}/tilesources/*.json".format(parent)):
pid = os.path.basename(path).replace(".json", "")
# Local definitions override global ones.
Expand Down

0 comments on commit 39eba3e

Please sign in to comment.