rbbz: fix flake8 issues (
bug 1255278) r?mdoglio
MozReview-Commit-ID: LnR0sGtbFeX
--- a/pylib/rbbz/rbbz/diffs.py
+++ b/pylib/rbbz/rbbz/diffs.py
@@ -126,18 +126,18 @@ def get_file_chunks_in_range_custom(cont
assert num_lines >= 0
if num_lines == 0:
break
def render_equal_chunk(chunk, parser):
indents = chunk['meta'].get('indentation_changes', {})
- lines = [] # Rendered lines.
- indent_count = 0 # How many indentation lines have we seen in a row.
+ lines = [] # Rendered lines.
+ indent_count = 0 # How many indentation lines have we seen in a row.
for line in chunk['lines']:
indent_key = "%s-%s" % (line[1], line[4])
if indent_key not in indents:
indent_count = 0
lines.append("> %s" % parser.unescape(line[5]))
continue
@@ -170,23 +170,23 @@ def render_equal_chunk(chunk, parser):
chars = line[2][21:(original_len - patched_len)]
index = 0
replace_chars = []
current_width = 0
# Parse the indentation characters
while index < len(chars):
- if chars[index] == "&" and chars[index + 1] == "g": # ">".
+ if chars[index] == "&" and chars[index + 1] == "g": # ">".
# Space character
- replace_chars.append(" ");
+ replace_chars.append(" ")
current_width += 1
index += 4
- elif chars[index] == "&" and chars[index + 1] == "m": # "—".
+ elif chars[index] == "&" and chars[index + 1] == "m": # "—".
# One of the spaces we translated before
# was actually part of this tab we've
# found
replace_chars.pop()
# find the end of the tab.
while chars[index] != "|":
current_width += 1
@@ -224,16 +224,17 @@ def render_equal_chunk(chunk, parser):
add_line = "> +%s" % remainder
remove_line = "> -%s%s" % ("".join(replace_chars), remainder)
lines.insert(len(lines) - indent_count, remove_line)
lines.append(add_line)
return lines
+
def render_comment_plain(comment, context, is_reply):
if is_reply:
parent_comment = comment.reply_to
# We will quote the last comment on the
# parent as this is most likely a discussion
# and not a reply to the original review
# comment.