1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Ran 2to3 on pysollib/[a-i]*.py

This commit is contained in:
Shlomi Fish 2017-04-27 21:42:07 +03:00
parent 890a948d8b
commit ae8a125087

View file

@ -68,7 +68,7 @@ def init():
pysollib.settings.DEBUG = int(os.environ['PYSOL_DEBUG']) pysollib.settings.DEBUG = int(os.environ['PYSOL_DEBUG'])
except: except:
pysollib.settings.DEBUG = 1 pysollib.settings.DEBUG = 1
print('PySol debugging: set DEBUG to', pysollib.settings.DEBUG) print(('PySol debugging: set DEBUG to', pysollib.settings.DEBUG))
# init toolkit # init toolkit
if '--gtk' in sys.argv: if '--gtk' in sys.argv:
@ -83,13 +83,13 @@ def init():
pysollib.settings.USE_TILE = True pysollib.settings.USE_TILE = True
sys.argv.remove('--tile') sys.argv.remove('--tile')
if pysollib.settings.TOOLKIT == 'tk': if pysollib.settings.TOOLKIT == 'tk':
import Tkinter from six.moves import tkinter
root = Tkinter.Tk(className=pysollib.settings.TITLE) root = tkinter.Tk(className=pysollib.settings.TITLE)
root.withdraw() root.withdraw()
if Tkinter.TkVersion < 8.4: if tkinter.TkVersion < 8.4:
# we need unicode support # we need unicode support
sys.exit("%s needs Tcl/Tk 8.4 or better (you have %s)" % sys.exit("%s needs Tcl/Tk 8.4 or better (you have %s)" %
(pysollib.settings.TITLE, str(Tkinter.TkVersion))) (pysollib.settings.TITLE, str(tkinter.TkVersion)))
pysollib.settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem') pysollib.settings.WIN_SYSTEM = root.tk.call('tk', 'windowingsystem')
if pysollib.settings.WIN_SYSTEM == 'aqua': if pysollib.settings.WIN_SYSTEM == 'aqua':
# TkAqua displays the console automatically in application # TkAqua displays the console automatically in application
@ -102,13 +102,13 @@ def init():
pysollib.settings.USE_TILE = False pysollib.settings.USE_TILE = False
try: try:
root.tk.eval('package require tile 0.7.8') root.tk.eval('package require tile 0.7.8')
except Tkinter.TclError: except tkinter.TclError:
pass pass
else: else:
pysollib.settings.USE_TILE = True pysollib.settings.USE_TILE = True
# "can't invoke event <<ThemeChanged>>: application has been destroyed" # "can't invoke event <<ThemeChanged>>: application has been destroyed"
# root.destroy() # root.destroy()
Tkinter._default_root = None tkinter._default_root = None
# check FreeCell-Solver # check FreeCell-Solver
pysollib.settings.USE_FREECELL_SOLVER = False pysollib.settings.USE_FREECELL_SOLVER = False