]> git.lyx.org Git - features.git/commitdiff
Protect postats.py script from silly errors.
authorRichard Heck <rgheck@lyx.org>
Mon, 25 Jun 2012 14:09:26 +0000 (10:09 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 25 Jun 2012 14:09:26 +0000 (10:09 -0400)
po/postats.py

index ca4787cf29bef4ca4e9688516af07e96d0e9d819..65be90ee9f760fa5d9a7e6eafe2cb1be7b370cb5 100755 (executable)
@@ -106,9 +106,13 @@ def run_msgfmt(pofile):
     prop = {}
     prop["langcode"] = os.path.basename(pofile)[:-3]
     prop["date"] = header['PO-Revision-Date'].split()[0]
-    prop["email"] = header['Last-Translator'].split('<')[1][:-1]
-    prop["email"] = prop["email"].replace("@", " () ")
-    prop["email"] = prop["email"].replace(".", " ! ")
+    print header['Last-Translator']
+    try:
+      prop["email"] = header['Last-Translator'].split('<')[1][:-1]
+      prop["email"] = prop["email"].replace("@", " () ")
+      prop["email"] = prop["email"].replace(".", " ! ")
+    except:
+      prop["email"] = "lyx-devel()lyx!org"
     translator = header['Last-Translator'].split('<')[0].strip()
     try:
         prop["translator"] = translator.decode(charset).encode('ascii','xmlcharrefreplace')