[qt4] make pylint a little more happy

error while publishing ReST text :related to: #107995
authorAlain Leufroy <alain@leufroy.fr>
changesetd694f63f3b2d
branchdefault
phasedraft
hiddenyes
parent revision#53e146ed34f0 [qt4] move scintilla code into dedicated class
child revision#771e2bcecf67 [qt4] add an intuitive link to display heavy files (closes #109862)
files modified by this revision
hgviewlib/qt4/hgfileview.py
# HG changeset patch
# User Alain Leufroy <alain@leufroy.fr>
# Date 1368240277 -7200
# Sat May 11 04:44:37 2013 +0200
# Node ID d694f63f3b2d0e6a713d618fceb9dab9f335d3c0
# Parent 53e146ed34f0b558176f1f368ab139f8ca565f6a
[qt4] make pylint a little more happy

:related to: #107995

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
@@ -202,10 +202,13 @@
1 
2      message_logged = pyqtSignal(str, int)
3      rev_for_diff_changed = pyqtSignal(int)
4 
5      def __init__(self, parent=None):
6 +        self._diff = None
7 +        self._diffs = None
8 +        self.cfg = None
9          QtGui.QFrame.__init__(self, parent)
10          framelayout = QtGui.QVBoxLayout(self)
11          framelayout.setContentsMargins(0,0,0,0)
12          framelayout.setSpacing(0)
13 
@@ -442,11 +445,11 @@
14              parent = self._model.graph.fileparent(self._filename, self._ctx.rev())
15              if parent is None:
16                  return
17              m = self._ctx.filectx(self._filename).renamed()
18              if m:
19 -                pfilename, pnode = m
20 +                pfilename, __ = m
21              else:
22                  pfilename = self._filename
23              _, parentdata = self._model.graph.filedata(pfilename,
24                                                         parent, 'file')
25              if parentdata is not None:
@@ -459,12 +462,13 @@
26                  self.blk.syncPageStep()
27                  self.timer.start()
28 
29      def _nextDiff(self):
30          if self._mode == 'file':
31 -            row, column = self.sci.getCursorPosition()
32 -            for i, (lo, hi) in enumerate(self._diffs):
33 +            row, __ = self.sci.getCursorPosition()
34 +            lo = 0
35 +            for i, (lo, __) in enumerate(self._diffs):
36                  if lo > row:
37                      last = (i == (len(self._diffs)-1))
38                      break
39              else:
40                  return False
@@ -477,11 +481,12 @@
41          self.sci.actions['next'].setEnabled(self.fileMode() and notlast and self.nDiffs())
42          self.sci.actions['prev'].setEnabled(self.fileMode() and self.nDiffs())
43 
44      def _prevDiff(self):
45          if self._mode == 'file':
46 -            row, column = self.sci.getCursorPosition()
47 +            row, __ = self.sci.getCursorPosition()
48 +            lo = 0
49              for i, (lo, hi) in enumerate(reversed(self._diffs)):
50                  if hi < row:
51                      first = (i == (len(self._diffs)-1))
52                      break
53              else:
@@ -545,31 +550,26 @@
54          # we make a burst of diff-lines computed at once, but we
55          # disable GUI updates for efficiency reasons, then only
56          # refresh GUI at the end of the burst
57          self.sci.setUpdatesEnabled(False)
58          self.blk.setUpdatesEnabled(False)
59 -        for n in range(30): # burst pool
60 +        for __ in range(30): # burst pool
61              if self._diff is None or not self._diff.get_opcodes():
62                  self._diff = None
63                  self.timer.stop()
64                  self.sci.actions['next'].setEnabled(self.fileMode() and self.nDiffs())
65                  break
66 
67 -            tag, alo, ahi, blo, bhi = self._diff.get_opcodes().pop(0)
68 +            tag, __, __, blo, bhi = self._diff.get_opcodes().pop(0)
69              if tag == 'replace':
70                  self._diffs.append([blo, bhi])
71                  self.blk.addBlock('x', blo, bhi)
72                  for i in range(blo, bhi):
73                      self.sci.markerAdd(i, self.sci.markertriangle)
74 
75              elif tag == 'delete':
76                  pass
77 -                # self.block['left'].addBlock('-', alo, ahi)
78 -                # self.diffblock.addBlock('-', alo, ahi, blo, bhi)
79 -                # w = self.viewers['left']
80 -                # for i in range(alo, ahi):
81 -                #     w.markerAdd(i, self.sci.markerminus)
82 
83              elif tag == 'insert':
84                  self._diffs.append([blo, bhi])
85                  self.blk.addBlock('+', blo, bhi)
86                  for i in range(blo, bhi):