fix linting

This commit is contained in:
Samuel Attard 2018-06-22 13:43:39 +10:00
parent daa64e21f6
commit d068ff3afb
3 changed files with 11 additions and 11 deletions

View file

@ -129,7 +129,7 @@ These individual tutorials expand on topics discussed in the guide above.
* [Menu](api/menu.md) * [Menu](api/menu.md)
* [MenuItem](api/menu-item.md) * [MenuItem](api/menu-item.md)
* [net](api/net.md) * [net](api/net.md)
* [netLog](api/netLog.md) * [netLog](api/net-log.md)
* [powerMonitor](api/power-monitor.md) * [powerMonitor](api/power-monitor.md)
* [powerSaveBlocker](api/power-save-blocker.md) * [powerSaveBlocker](api/power-save-blocker.md)
* [protocol](api/protocol.md) * [protocol](api/protocol.md)

View file

@ -1,6 +1,6 @@
# API Contract # API Contract
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](electron-versioning.md#semver) before the change is made. Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](../tutorial/electron-versioning.md#semver) before the change is made.
# `FIXME` comments # `FIXME` comments

View file

@ -223,15 +223,15 @@ def SubString(lines, start, end):
return ''.join(result_lines) return ''.join(result_lines)
def StripMetaComments(str): def StripMetaComments(_str):
"""Strip meta comments from each line in the given string.""" """Strip meta comments from each line in the given string."""
# First, completely remove lines containing nothing but a meta # First, completely remove lines containing nothing but a meta
# comment, including the trailing \n. # comment, including the trailing \n.
str = re.sub(r'^\s*\$\$.*\n', '', str) _str = re.sub(r'^\s*\$\$.*\n', '', _str)
# Then, remove meta comments from contentful lines. # Then, remove meta comments from contentful lines.
return re.sub(r'\s*\$\$.*', '', str) return re.sub(r'\s*\$\$.*', '', _str)
def MakeToken(lines, start, end, token_type): def MakeToken(lines, start, end, token_type):
@ -476,16 +476,16 @@ def ParseElseNode(tokens):
def Pop(token_type=None): def Pop(token_type=None):
return PopToken(tokens, token_type) return PopToken(tokens, token_type)
next = PeekToken(tokens) _next = PeekToken(tokens)
if not next: if not next:
return None return None
if next.token_type == '$else': if _next.token_type == '$else':
Pop('$else') Pop('$else')
Pop('[[') Pop('[[')
code_node = ParseCodeNode(tokens) code_node = ParseCodeNode(tokens)
Pop(']]') Pop(']]')
return code_node return code_node
elif next.token_type == '$elif': elif _next.token_type == '$elif':
Pop('$elif') Pop('$elif')
exp = Pop('code') exp = Pop('code')
Pop('[[') Pop('[[')
@ -493,7 +493,7 @@ def ParseElseNode(tokens):
Pop(']]') Pop(']]')
inner_else_node = ParseElseNode(tokens) inner_else_node = ParseElseNode(tokens)
return CodeNode([IfNode(ParseExpNode(exp), code_node, inner_else_node)]) return CodeNode([IfNode(ParseExpNode(exp), code_node, inner_else_node)])
elif not next.value.strip(): elif not _next.value.strip():
Pop('code') Pop('code')
return ParseElseNode(tokens) return ParseElseNode(tokens)
else: else:
@ -511,8 +511,8 @@ def ParseAtomicCodeNode(tokens):
elif t == '$var': elif t == '$var':
id_token = Pop('id') id_token = Pop('id')
Pop('=') Pop('=')
next = PeekToken(tokens) _next = PeekToken(tokens)
if next.token_type == 'exp': if _next.token_type == 'exp':
exp_token = Pop() exp_token = Pop()
return VarNode(id_token, ParseExpNode(exp_token)) return VarNode(id_token, ParseExpNode(exp_token))
Pop('[[') Pop('[[')