[Pkg-isocodes-devel] [iso-codes] 03/07: Use the data directory as second argument
Tobias Quathamer
toddy at moszumanska.debian.org
Fri Mar 4 13:07:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
toddy pushed a commit to branch master
in repository iso-codes.
commit 3873803a1751465d0b321c74dea43961678a4b99
Author: Dr. Tobias Quathamer <toddy at debian.org>
Date: Fri Mar 4 13:25:28 2016 +0100
Use the data directory as second argument
---
bin/pot_from_json.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/bin/pot_from_json.py b/bin/pot_from_json.py
index 36851c9..9e7d996 100755
--- a/bin/pot_from_json.py
+++ b/bin/pot_from_json.py
@@ -22,10 +22,11 @@ import json
import sys
import time
-# Get the current ISO code domain
-if len(sys.argv) != 2:
- sys.exit("Please provide the domain.")
+# Get the current ISO code domain and the path to the JSON data dir
+if len(sys.argv) != 3:
+ sys.exit("Please provide the domain and the path to the JSON data dir.")
domain = sys.argv[1]
+datapath = sys.argv[2]
# The number starts after "iso_", so always after four characters
iso_number = domain[4:]
@@ -52,7 +53,7 @@ if domain == "iso_3166-2":
comment = "alpha_2"
# Read in the JSON file
-with open("data/" + domain + ".json") as json_file:
+with open(datapath + "/" + domain + ".json") as json_file:
iso = json.load(json_file)
# Helper function for keeping track of msgids and comments
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-isocodes/iso-codes.git
More information about the Pkg-isocodes-devel
mailing list