fix bug in template exec pattern
This commit is contained in:
parent
2553bc14af
commit
96fba06709
@ -14,7 +14,7 @@ class Template:
|
|||||||
self,
|
self,
|
||||||
template_str : str,
|
template_str : str,
|
||||||
key_pattern : str = r'f{{(\S+?)}}',
|
key_pattern : str = r'f{{(\S+?)}}',
|
||||||
exe_pattern : str = r'x{{(.*)}}',
|
exe_pattern : str = r'x{{((?:(?!x{{).)*)}}',
|
||||||
):
|
):
|
||||||
self.template_str = template_str
|
self.template_str = template_str
|
||||||
self.key_pattern = key_pattern
|
self.key_pattern = key_pattern
|
||||||
@ -67,7 +67,7 @@ class FileTemplate(Template):
|
|||||||
self,
|
self,
|
||||||
path: Path,
|
path: Path,
|
||||||
key_pattern: str = r'f{{(\S+?)}}',
|
key_pattern: str = r'f{{(\S+?)}}',
|
||||||
exe_pattern: str = r'x{{(.*)}}',
|
exe_pattern : str = r'x{{((?:(?!x{{).)*)}}',
|
||||||
):
|
):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
path.open('r').read(),
|
path.open('r').read(),
|
||||||
@ -80,7 +80,7 @@ class TOMLTemplate(FileTemplate):
|
|||||||
self,
|
self,
|
||||||
toml_path: Path,
|
toml_path: Path,
|
||||||
key_pattern: str = r'f{{(\S+?)}}',
|
key_pattern: str = r'f{{(\S+?)}}',
|
||||||
exe_pattern: str = r'x{{(.*)}}',
|
exe_pattern : str = r'x{{((?:(?!x{{).)*)}}',
|
||||||
):
|
):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
toml_path,
|
toml_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user