mo processing test
This commit is contained in:
parent
e14180cbe7
commit
9166790de9
5 changed files with 31 additions and 3 deletions
|
|
@ -6,6 +6,10 @@ from injectable import injectable, autowired, Autowired
|
|||
|
||||
from app.services import Passwords
|
||||
|
||||
class DotTemplate(Template):
|
||||
# Pozwala na kropki w nazwach placeholderów, np. ${user.name.first}
|
||||
idpattern = r'[_a-zA-Z][_a-zA-Z0-9.]*'
|
||||
|
||||
|
||||
@injectable
|
||||
class Mo:
|
||||
|
|
@ -17,7 +21,7 @@ class Mo:
|
|||
raw = ''
|
||||
with open(mo_file, "r") as mo:
|
||||
raw = mo.read()
|
||||
tpl = Template(raw)
|
||||
tpl = DotTemplate(raw)
|
||||
rendered = tpl.substitute(self._passwords.get_values(tpl.get_identifiers()))
|
||||
de_mo_ified = str(mo_file).replace(".mo", "")
|
||||
with open(de_mo_ified, "w") as mo:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue