1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00
This commit is contained in:
Shlomi Fish 2017-04-17 12:18:07 +03:00
parent 3be5f2a99a
commit 389143ec23
2 changed files with 9 additions and 4 deletions

View file

@ -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). GUI application (as opposed to an X11 application).
""" """
import sys import sys
from Tkinter import Menu, Text, TclError from Tkinter import TclError
def runningAsOSXApp(): 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]) return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0])
def hideTkConsole(root): def hideTkConsole(root):
try: try:
root.tk.call('console', 'hide') root.tk.call('console', 'hide')
except TclError: except TclError:
pass pass
def setupApp(app): def setupApp(app):
""" """
Perform setup for the OSX application bundle. Perform setup for the OSX application bundle.
""" """
if not runningAsOSXApp(): return if not runningAsOSXApp():
return
hideTkConsole(app.top) hideTkConsole(app.top)

View file

@ -10,7 +10,7 @@ use String::ShellQuote qw/ shell_quote /;
# my $cmd = shell_quote( 'flake8', '.' ); # my $cmd = shell_quote( 'flake8', '.' );
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 # TEST
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." ); eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );