[qt4] make pylint a little happier

error while publishing ReST text :related to: #107995
authorAlain Leufroy <alain@leufroy.fr>
changeset324d7a6fbd41
branchdefault
phasedraft
hiddenyes
parent revision#faeefee26955 [qt4] hide text area on heavy file
child revision#4b2a7383b1a2 [qt4] display "maxfilesize" config entry on big file (closes #109863)
files modified by this revision
hgviewlib/qt4/hgfileview.py
# HG changeset patch
# User Alain Leufroy <alain@leufroy.fr>
# Date 1368251022 -7200
# Sat May 11 07:43:42 2013 +0200
# Node ID 324d7a6fbd419e66dfb20d2a99b36d95dc62b40e
# Parent faeefee26955a484acb72ec674c456109e1dd371
[qt4] make pylint a little happier

:related to: #107995

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
@@ -13,32 +13,28 @@
1  # You should have received a copy of the GNU General Public License along with
2  # this program.  If not, see <http://www.gnu.org/licenses/>.
3  """
4  Qt4 high level widgets for hg repo changelogs and filelogs
5  """
6 -import sys
7  import difflib
8 +from itertools import imap
9 
10  from mercurial.node import hex, short as short_hex, bin as short_bin
11 -from mercurial import util
12  try:
13      from mercurial.error import LookupError
14  except ImportError:
15      from mercurial.revlog import LookupError
16 
17  from PyQt4 import QtCore, QtGui, Qsci
18  from PyQt4.QtCore import pyqtSignal
19  Qt = QtCore.Qt
20 
21 -from hgviewlib.decorators import timeit
22  from hgviewlib.util import exec_flag_changed, isbfile, bfilepath, tounicode
23  from hgviewlib.config import HgConfig
24 
25  from hgviewlib.qt4 import icon as geticon
26  from hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer
27 -from hgviewlib.qt4.hgmanifestdialog import ManifestViewer
28 -from hgviewlib.qt4.quickbar import QuickBar
29  from hgviewlib.qt4.lexers import get_lexer
30  from hgviewlib.qt4.blockmatcher import BlockList
31 
32  qsci = Qsci.QsciScintilla
33 
@@ -77,19 +73,18 @@
34          textarea.verticalScrollBar().valueChanged[int].connect(
35                  self.verticalScrollBar().setValue)
36 
37      def setFilectx(self, fctx):
38          self.fctx = fctx
39 -        ann = [f.rev() for f, line in fctx.annotate(follow=True)]
40 -        self.setText('\n'.join(map(str, ann)))
41 +        ann = [f.rev() for f, __ in fctx.annotate(follow=True)]
42 +        self.setText('\n'.join(imap(str, ann)))
43          allrevs = list(sorted(set(ann)))
44          for i, rev in enumerate(ann):
45              idx = allrevs.index(rev)
46              self.markerAdd(i, self.markers[idx % len(self.markers)])
47 
48 
49 -
50  class HgQsci(qsci):
51 
52      def __init__(self, *args, **kwargs):
53          super(HgQsci, self).__init__(*args, **kwargs)
54          super(HgQsci, self).setUtf8(True)