Skip to content

Commit 8d25396

Browse files
committed
Fix all flake8 errors
1 parent 362c59f commit 8d25396

File tree

18 files changed

+487
-420
lines changed

18 files changed

+487
-420
lines changed

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
builtins = _
3+
max-line-length = 100
4+
5+
# Temporary
6+
exclude = src/diffuse/main.py

src/diffuse/dialogs.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@
1919

2020
import os
2121

22-
# pylint: disable=wrong-import-position
22+
from diffuse import constants
23+
from diffuse import utils
24+
2325
import gi
2426
gi.require_version('GObject', '2.0')
2527
gi.require_version('Gtk', '3.0')
26-
from gi.repository import GObject, Gtk
27-
# pylint: enable=wrong-import-position
28+
from gi.repository import GObject, Gtk # noqa: E402
2829

29-
# pylint: disable-next=no-name-in-module
30-
from diffuse import constants
31-
32-
from diffuse import utils
3330

3431
# the about dialog
3532
class AboutDialog(Gtk.AboutDialog):
@@ -41,8 +38,8 @@ def __init__(self):
4138
self.set_comments(_('Diffuse is a graphical tool for merging and comparing text files.'))
4239
self.set_copyright(constants.COPYRIGHT)
4340
self.set_website(constants.WEBSITE)
44-
self.set_authors([ 'Derrick Moser <[email protected]>',
45-
'Romain Failliot <[email protected]>' ])
41+
self.set_authors(['Derrick Moser <[email protected]>',
42+
'Romain Failliot <[email protected]>'])
4643
self.set_translator_credits(_('translator-credits'))
4744
license_text = [
4845
constants.APP_NAME + ' ' + constants.VERSION + '\n\n',
@@ -59,9 +56,10 @@ def __init__(self):
5956
6057
You should have received a copy of the GNU General Public License along
6158
with this program; if not, write to the Free Software Foundation, Inc.,
62-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.''') ]
59+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.''')]
6360
self.set_license(''.join(license_text))
6461

62+
6563
# custom dialogue for picking files with widgets for specifying the encoding
6664
# and revision
6765
class FileChooserDialog(Gtk.FileChooserDialog):
@@ -85,7 +83,7 @@ def __init__(self, title, parent, prefs, action, accept, rev=False):
8583
label.show()
8684
self.encoding = entry = utils.EncodingMenu(
8785
prefs,
88-
action in [ Gtk.FileChooserAction.OPEN, Gtk.FileChooserAction.SELECT_FOLDER ])
86+
action in [Gtk.FileChooserAction.OPEN, Gtk.FileChooserAction.SELECT_FOLDER])
8987
hbox.pack_start(entry, False, False, 5)
9088
entry.show()
9189
if rev:
@@ -96,7 +94,7 @@ def __init__(self, title, parent, prefs, action, accept, rev=False):
9694
hbox.pack_end(label, False, False, 0)
9795
label.show()
9896

99-
self.vbox.pack_start(hbox, False, False, 0) # pylint: disable=no-member
97+
self.vbox.pack_start(hbox, False, False, 0)
10098
hbox.show()
10199
self.set_current_folder(self.last_chosen_folder)
102100
self.connect('current-folder-changed', self._current_folder_changed_cb)
@@ -110,10 +108,10 @@ def get_encoding(self):
110108
def get_revision(self):
111109
return self.revision.get_text()
112110

113-
# pylint: disable-next=arguments-differ
114111
def get_filename(self):
115112
# convert from UTF-8 string to unicode
116-
return Gtk.FileChooserDialog.get_filename(self) # pylint: disable=no-member
113+
return Gtk.FileChooserDialog.get_filename(self)
114+
117115

118116
# dialogue used to search for text
119117
class NumericDialog(Gtk.Dialog):
@@ -138,12 +136,13 @@ def __init__(self, parent, title, text, val, lower, upper, step=1, page=0):
138136
vbox.pack_start(hbox, True, True, 0)
139137
hbox.show()
140138

141-
self.vbox.pack_start(vbox, False, False, 0) # pylint: disable=no-member
139+
self.vbox.pack_start(vbox, False, False, 0)
142140
vbox.show()
143141

144142
def button_cb(self, widget):
145143
self.response(Gtk.ResponseType.ACCEPT)
146144

145+
147146
# dialogue used to search for text
148147
class SearchDialog(Gtk.Dialog):
149148
def __init__(self, parent, pattern=None, history=None):
@@ -190,7 +189,7 @@ def __init__(self, parent, pattern=None, history=None):
190189
vbox.pack_start(button, False, False, 0)
191190
button.show()
192191

193-
self.vbox.pack_start(vbox, False, False, 0) # pylint: disable=no-member
192+
self.vbox.pack_start(vbox, False, False, 0)
194193
vbox.show()
195194

196195
# callback used when the Enter key is pressed

0 commit comments

Comments
 (0)