[Pkg-isocodes-devel] [iso-codes] 02/04: Convert domains to old style for downloading

Tobias Quathamer toddy at moszumanska.debian.org
Fri Apr 8 15:46: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 5d3945cd4e675c1baf02867e63a05c09a40847fe
Author: Dr. Tobias Quathamer <toddy at debian.org>
Date:   Fri Apr 8 17:05:03 2016 +0200

    Convert domains to old style for downloading
---
 bin/iso-codes-merge.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/iso-codes-merge.py b/bin/iso-codes-merge.py
index 9054421..a5d4db3 100755
--- a/bin/iso-codes-merge.py
+++ b/bin/iso-codes-merge.py
@@ -100,6 +100,12 @@ class Isocodes(object):
         self.tmpfiles = []
 
     def _getUrl(self, domain, lang):
+        # Convert domains to old style for downloading
+        domain = domain.replace("-", "_")
+        if domain == "iso_3166_1":
+            domain = "iso_3166"
+        if domain == "iso_639_2":
+            domain = "iso_639"
         return "http://translationproject.org/latest/%s/%s.po" % (domain, lang)
 
     def _msgfmt(self, fname):
@@ -111,6 +117,8 @@ class Isocodes(object):
 
     def _msgcanonicalformat(self, fname, domain):
         logging.info(fname)
+        potfile = os.path.join(self.home, domain, domain+".pot")
+        subprocess.check_call(['msgmerge', '-o', fname, fname, potfile])
         subprocess.check_call(['msgattrib', '--no-obsolete', '-o', fname, fname])
         subprocess.check_call(['sed', '-i', '-e', 's/^"Project-Id-Version: iso.*/"Project-Id-Version: ' + domain + '\\\\n"/', fname])
 

-- 
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