Fixes in regular expressions
This commit is contained in:
parent
c5ed70e5ca
commit
f4199d5ad3
4 changed files with 15 additions and 13 deletions
|
|
@ -38,12 +38,12 @@ except:
|
|||
"""Command line utility for extract I18n.lang strings from html templates and .py files
|
||||
"""
|
||||
|
||||
pattern=re.compile('^\w+\.(py|html|phtml|js)$')
|
||||
pattern=re.compile(r'^\w+\.(py|html|phtml|js)$')
|
||||
|
||||
ignored=re.compile('^[__|\.].*$')
|
||||
ignored=re.compile(r'^[__|\.].*$')
|
||||
|
||||
lang_p=re.compile("I18n\.lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
lang_t=re.compile("\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||
lang_p=re.compile(r"I18n\.lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
lang_t=re.compile(r"\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||
|
||||
tmp_lang={}
|
||||
|
||||
|
|
@ -76,9 +76,9 @@ def start():
|
|||
|
||||
module_base=os.path.basename(args.module)
|
||||
|
||||
lang_p=re.compile("I18n\.lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
lang_p=re.compile(r"I18n\.lang\('("+module_base+r"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
#lang_t=re.compile("\${lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||
lang_t=re.compile("lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
lang_t=re.compile(r"lang\('("+module_base+r"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||
|
||||
if not os.path.isdir(path):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue