mirror of https://github.com/zulip/zulip.git
pep8: Add compliance with rule E261 to get-handlebar-vars.
This commit is contained in:
parent
bc987c99ca
commit
151712b9cc
|
@ -19,9 +19,9 @@ def parse_file(fn):
|
||||||
# type: (str) -> Dict[str, Any]
|
# type: (str) -> Dict[str, Any]
|
||||||
text = open(fn).read()
|
text = open(fn).read()
|
||||||
tags = re.findall('{+\s*(.*?)\s*}+', text)
|
tags = re.findall('{+\s*(.*?)\s*}+', text)
|
||||||
root = {} # type: Dict[str, Any]
|
root = {} # type: Dict[str, Any]
|
||||||
context = root
|
context = root
|
||||||
stack = [] # type: List[Dict[str, Any]]
|
stack = [] # type: List[Dict[str, Any]]
|
||||||
|
|
||||||
def set_var(var, val):
|
def set_var(var, val):
|
||||||
# type: (str, Any) -> None
|
# type: (str, Any) -> None
|
||||||
|
@ -58,7 +58,7 @@ def parse_file(fn):
|
||||||
|
|
||||||
if tag.startswith('#with '):
|
if tag.startswith('#with '):
|
||||||
var = tag.split()[1]
|
var = tag.split()[1]
|
||||||
new_context = {} # type: Dict[str, Any]
|
new_context = {} # type: Dict[str, Any]
|
||||||
context[var] = new_context
|
context[var] = new_context
|
||||||
stack.append(context)
|
stack.append(context)
|
||||||
context = new_context
|
context = new_context
|
||||||
|
|
Loading…
Reference in New Issue