From: Dan Scott Date: Mon, 9 Apr 2012 13:37:57 +0000 (-0400) Subject: i18n: Robustify db-seed-i18n.py parsing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=161eac08101524a72592fe9c8610ab8e0c881729;p=evergreen%2Ftadl.git i18n: Robustify db-seed-i18n.py parsing Faced with the perplexing use of a space before a comma in oils_i18n_gettext() keys, db-seed-i18n.py's regex failed. The solution for a sloppy regex? More powerful regex! Signed-off-by: Dan Scott Signed-off-by: Thomas Berezansky --- diff --git a/build/i18n/scripts/db-seed-i18n.py b/build/i18n/scripts/db-seed-i18n.py index 7f3419461a..990afcc08e 100755 --- a/build/i18n/scripts/db-seed-i18n.py +++ b/build/i18n/scripts/db-seed-i18n.py @@ -55,8 +55,8 @@ class SQL(basel10n.BaseL10N): num = 0 findi18n = re.compile(r'.*?oils_i18n_gettext\((.*?)\'\)') - intkey = re.compile(r'\s*(?P\d+),\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') - textkey = re.compile(r'\s*\'(?P.*?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') + intkey = re.compile(r'\s*(?P\d+)\s*,\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') + textkey = re.compile(r'\s*\'(?P.*?)\'\s*,\s*\'(?P.+?)\',\s*\'(?P.+?)\',\s*\'(?P.+?)$') serts = dict() # Iterate through the source SQL grabbing table names and l10n strings