From 8a8314ce864f6ce82cf459e3609f97f01b9b17a6 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 17 Apr 2017 14:27:58 +0300 Subject: [PATCH] flake8 --- pysollib/pysolgtk/toolbar.py | 49 ++++++++---------------------------- tests/style/py-flake8.t | 2 +- 2 files changed, 11 insertions(+), 40 deletions(-) diff --git a/pysollib/pysolgtk/toolbar.py b/pysollib/pysolgtk/toolbar.py index 801b6484..720157d0 100644 --- a/pysollib/pysolgtk/toolbar.py +++ b/pysollib/pysolgtk/toolbar.py @@ -23,18 +23,15 @@ # imports -import os, re, sys import gtk -from gtk import gdk # PySol imports - - # ************************************************************************ # * # ************************************************************************ + class PysolToolbarTk: def __init__(self, top, menubar, dir, size=0, relief=0, compound=None): self.top = top @@ -42,30 +39,7 @@ class PysolToolbarTk: self.dir = dir self.side = -1 - ui_info = ''' - - - - - - - - - - - - - - - - - - - - -''' - ui_manager = self.top.ui_manager # created in menubar.py - ui_manager_id = ui_manager.add_ui_from_string(ui_info) + ui_manager = self.top.ui_manager # created in menubar.py toolbar = ui_manager.get_widget("/toolbar") self.toolbar = toolbar @@ -74,18 +48,17 @@ class PysolToolbarTk: self._attached = False - # # wrappers # def _busy(self): - return not (self.side and self.game and not self.game.busy and self.menubar) + return not (self.side and self.game and not self.game.busy + and self.menubar) def destroy(self): self.toolbar.destroy() - # # public methods # @@ -122,13 +95,12 @@ class PysolToolbarTk: x, y = 2, 2 # set orient if side in (1, 2): - orient = gtk.ORIENTATION_HORIZONTAL + orient = gtk.ORIENTATION_HORIZONTAL else: - orient = gtk.ORIENTATION_VERTICAL + orient = gtk.ORIENTATION_VERTICAL self.toolbar.set_orientation(orient) if self._attached: self.top.table.remove(self.toolbar) - row_span, column_span = 1, 1 self.top.table.attach(self.toolbar, x, x+1, y, y+1, gtk.FILL, gtk.FILL, @@ -137,11 +109,11 @@ class PysolToolbarTk: self._attached = True return 1 - def setCursor(self, cursor): - if self.side: - if self.toolbar.window: - self.toolbar.window.set_cursor(gdk.Cursor(v)) + pass + # if self.side: + # if self.toolbar.window: + # self.toolbar.window.set_cursor(gdk.Cursor(v)) def setRelief(self, relief): # FIXME @@ -154,4 +126,3 @@ class PysolToolbarTk: def config(self, w, v): # FIXME pass - diff --git a/tests/style/py-flake8.t b/tests/style/py-flake8.t index 1d2269f0..07b1ce46 100644 --- a/tests/style/py-flake8.t +++ b/tests/style/py-flake8.t @@ -10,7 +10,7 @@ use String::ShellQuote qw/ shell_quote /; # my $cmd = shell_quote( 'flake8', '.' ); my $cmd = shell_quote( 'flake8', - grep { not($_ eq './pysollib/pysoltk.py') } glob('./pysollib/*.py ./pysollib/[cm]*/*.py ./pysollib/pysolgtk/{[a-s]*,t[a-i]*,tk*}.py') ); + grep { not($_ eq './pysollib/pysoltk.py') } glob('./pysollib/*.py ./pysollib/[cmp]*/*.py') ); # TEST eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );