rbbz: fix flake8 issues (bug 1255278) r?mdoglio draft
authorbyron jones <glob@mozilla.com>
Thu, 10 Mar 2016 12:33:58 +0800
changeset 7461 313520cf0834116f79bbcf4d8e1694872edee8ef
parent 7459 1481845a0ee4ebf9a4069ccdcf1390b981045644
child 7462 c61d86295172f4682f1898487477e5d5c8f79ba8
push id686
push userbjones@mozilla.com
push dateThu, 10 Mar 2016 05:04:24 +0000
reviewersmdoglio
bugs1255278
rbbz: fix flake8 issues (bug 1255278) r?mdoglio MozReview-Commit-ID: LnR0sGtbFeX
pylib/rbbz/rbbz/diffs.py
--- 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": # "&gt;".
+            if chars[index] == "&" and chars[index + 1] == "g":  # "&gt;".
                 # Space character
-                replace_chars.append(" ");
+                replace_chars.append(" ")
                 current_width += 1
                 index += 4
 
-            elif chars[index] == "&" and chars[index + 1] == "m": # "&mdash;".
+            elif chars[index] == "&" and chars[index + 1] == "m":  # "&mdash;".
                 # 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.