Protect postats.py script from silly errors.

This commit is contained in:
Richard Heck 2012-06-25 10:09:26 -04:00
parent 082db5e769
commit 5d9fb0d933

View File

@ -106,9 +106,13 @@ def run_msgfmt(pofile):
prop = {} prop = {}
prop["langcode"] = os.path.basename(pofile)[:-3] prop["langcode"] = os.path.basename(pofile)[:-3]
prop["date"] = header['PO-Revision-Date'].split()[0] prop["date"] = header['PO-Revision-Date'].split()[0]
prop["email"] = header['Last-Translator'].split('<')[1][:-1] print header['Last-Translator']
prop["email"] = prop["email"].replace("@", " () ") try:
prop["email"] = prop["email"].replace(".", " ! ") 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() translator = header['Last-Translator'].split('<')[0].strip()
try: try:
prop["translator"] = translator.decode(charset).encode('ascii','xmlcharrefreplace') prop["translator"] = translator.decode(charset).encode('ascii','xmlcharrefreplace')