[qt4] make pylint a little happier

error while publishing ReST text :related to: #107995
authorAlain Leufroy <alain@leufroy.fr>
changeset6c205f22ff50
branchdefault
phasedraft
hiddenyes
parent revision#de79532db4f9 [qt4] hide text area on heavy file
child revision#578d2b2572ab [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 6c205f22ff502538b1c16b3edb369b32e4c3daf3
# Parent de79532db4f9c03ac7e1b8700de9c31df3cd3bae
[qt4] make pylint a little happier

:related to: #107995

diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
@@ -13,34 +13,30 @@
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 os
8  import difflib
9  import tempfile
10 +from itertools import imap
11 
12  from mercurial.node import hex, short as short_hex, bin as short_bin
13 -from mercurial import util
14  try:
15      from mercurial.error import LookupError
16  except ImportError:
17      from mercurial.revlog import LookupError
18 
19  from PyQt4 import QtCore, QtGui, Qsci
20  from PyQt4.QtCore import pyqtSignal
21  Qt = QtCore.Qt
22 
23 -from hgviewlib.decorators import timeit
24  from hgviewlib.util import exec_flag_changed, isbfile, bfilepath, tounicode
25  from hgviewlib.config import HgConfig
26 
27  from hgviewlib.qt4 import icon as geticon
28  from hgviewlib.qt4.hgfiledialog import FileViewer, FileDiffViewer
29 -from hgviewlib.qt4.hgmanifestdialog import ManifestViewer
30 -from hgviewlib.qt4.quickbar import QuickBar
31  from hgviewlib.qt4.lexers import get_lexer
32  from hgviewlib.qt4.blockmatcher import BlockList
33 
34  qsci = Qsci.QsciScintilla
35 
@@ -79,19 +75,18 @@
36          textarea.verticalScrollBar().valueChanged[int].connect(
37                  self.verticalScrollBar().setValue)
38 
39      def setFilectx(self, fctx):
40          self.fctx = fctx
41 -        ann = [f.rev() for f, line in fctx.annotate(follow=True)]
42 -        self.setText('\n'.join(map(str, ann)))
43 +        ann = [f.rev() for f, __ in fctx.annotate(follow=True)]
44 +        self.setText('\n'.join(imap(str, ann)))
45          allrevs = list(sorted(set(ann)))
46          for i, rev in enumerate(ann):
47              idx = allrevs.index(rev)
48              self.markerAdd(i, self.markers[idx % len(self.markers)])
49 
50 
51 -
52  class HgQsci(qsci):
53 
54      def __init__(self, *args, **kwargs):
55          super(HgQsci, self).__init__(*args, **kwargs)
56          super(HgQsci, self).setUtf8(True)