From 389143ec2309d185304ff1eb9711fa1e92c7d536 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 17 Apr 2017 12:18:07 +0300 Subject: [PATCH] flake 8 --- pysollib/macosx/appSupport.py | 11 ++++++++--- tests/style/py-flake8.t | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pysollib/macosx/appSupport.py b/pysollib/macosx/appSupport.py index 6cbd9fc3..4ae80bbd 100644 --- a/pysollib/macosx/appSupport.py +++ b/pysollib/macosx/appSupport.py @@ -25,21 +25,26 @@ A number of function that enhance PySol on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys -from Tkinter import Menu, Text, TclError +from Tkinter import TclError + def runningAsOSXApp(): - """ Returns True if-and-only-if running from the PySol.app bundle on OSX """ + """ Returns True if-and-only-if running from the + PySol.app bundle on OSX """ return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0]) + def hideTkConsole(root): try: root.tk.call('console', 'hide') except TclError: pass + def setupApp(app): """ Perform setup for the OSX application bundle. """ - if not runningAsOSXApp(): return + if not runningAsOSXApp(): + return hideTkConsole(app.top) diff --git a/tests/style/py-flake8.t b/tests/style/py-flake8.t index 72871c29..18e2e136 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/configobj/*.py') ); + grep { not($_ eq './pysollib/pysoltk.py') } glob('./pysollib/*.py ./pysollib/[cm]*/*.py') ); # TEST eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );