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

import tkinter directly (#383)

* import tkinter directly

* linter

* linter
This commit is contained in:
Alexandre Detiste 2024-09-21 23:10:10 +02:00 committed by GitHub
parent 68d6b64fa2
commit dd16750d5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 70 additions and 72 deletions

View file

@ -102,7 +102,7 @@ def init():
sys.argv.remove('--kivy')
if pysollib.settings.TOOLKIT == 'tk':
from six.moves import tkinter
import tkinter
root = tkinter.Tk(className=pysollib.settings.TITLE)
root.withdraw()
if tkinter.TkVersion < 8.4:

View file

@ -23,7 +23,7 @@
# imports
# import os
# from six.moves import tkinter
# import tkinter
# import traceback
# # PySol imports

View file

@ -23,7 +23,7 @@
# imports
# import os
# from six.moves import tkinter
# import tkinter
# import traceback
# # PySol imports

View file

@ -24,7 +24,7 @@
# # imports
# import os, sys
# from six.moves import tkinter
# import tkinter
# # PySol imports
# from pysollib.mfxutil import KwStruct

View file

@ -21,11 +21,12 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from six.moves import tkinter_font
from six.moves import tkinter_ttk as ttk

View file

@ -21,10 +21,11 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxDialog

View file

@ -21,10 +21,11 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from pysollib.ui.tktile.tkutil import makeToplevel, setTransient
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
# ************************************************************************

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import KwStruct, USE_PIL
from pysollib.mygettext import _
@ -31,7 +32,6 @@ from pysollib.ui.tktile.tkcanvas import MfxCanvasImage
from pysollib.ui.tktile.tkutil import bind, loadImage
from pysollib.util import CARDSET
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .selecttree import SelectDialogTreeCanvas

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------
import os
import tkinter
from collections import UserList
from pysollib.gamedb import GI
@ -32,7 +33,6 @@ from pysollib.resource import CSI
from pysollib.ui.tktile.selecttree import SelectDialogTreeData
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .selecttree import SelectDialogTreeCanvas

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import KwStruct, USE_PIL
from pysollib.mygettext import _
@ -29,7 +30,6 @@ from pysollib.resource import TTI
from pysollib.ui.tktile.selecttree import SelectDialogTreeData
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from six.moves import tkinter_colorchooser
from six.moves import tkinter_ttk as ttk

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------
import os
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
@ -29,7 +30,6 @@ from pysollib.pysolaudio import pysolsoundserver
from pysollib.settings import TITLE
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxDialog, MfxMessageDialog

View file

@ -24,10 +24,10 @@
# imports
import os
import sys
import tkinter
from pysollib.mygettext import _
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxTooltip

View file

@ -21,10 +21,11 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxDialog, PysolScale

View file

@ -23,12 +23,12 @@
import os
import sys
import tkinter
from pysollib.mfxutil import Struct
from pysollib.mygettext import _
from pysollib.ui.tktile.tkhtml import Base_HTMLViewer
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .statusbar import HtmlStatusbar

View file

@ -23,6 +23,7 @@
import os
import time
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mfxutil import format_time
@ -31,7 +32,6 @@ from pysollib.settings import TOP_TITLE
from pysollib.stats import ProgressionFormatter, PysolStatsFormatter
from pysollib.ui.tktile.tkutil import bind, loadImage
from six.moves import tkinter
from six.moves import tkinter_font
from six.moves import tkinter_ttk as ttk

View file

@ -22,11 +22,10 @@
# ---------------------------------------------------------------------------
import os
import tkinter
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from .tkwidget import MfxScrolledCanvas

View file

@ -24,6 +24,7 @@
import locale
import os
import time
import tkinter
import traceback
from pysollib.mfxutil import KwStruct, destruct, kwdefault, openURL
@ -34,7 +35,6 @@ from pysollib.ui.tktile.tkutil import after, after_cancel
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
from pysollib.ui.tktile.tkutil import makeToplevel, setTransient
from six.moves import tkinter
from six.moves import tkinter_font
from six.moves import tkinter_ttk as ttk

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import Image, ImageOps, ImageTk
from pysollib.mygettext import _, n_
@ -32,7 +33,6 @@ from pysollib.ui.tktile.tkutil import loadImage
from pysollib.util import IMAGE_EXTENSIONS
from pysollib.winsystems import TkSettings
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxTooltip

View file

@ -21,12 +21,13 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.wizardpresets import presets
from pysollib.wizardutil import WizardWidgets
from six.moves import tkinter
from six.moves import tkinter_ttk as ttk
from .tkwidget import MfxDialog

View file

@ -1,6 +1,6 @@
from pysollib.tk.tkwidget import MfxDialog
import tkinter
from six.moves import tkinter
from pysollib.tk.tkwidget import MfxDialog
class BaseTkMfxDialog(MfxDialog):

View file

@ -21,12 +21,13 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.tk.tkwidget import MfxDialog
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from six.moves import tkinter_font

View file

@ -21,12 +21,12 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct, Struct
from pysollib.mygettext import _
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from .tkwidget import MfxDialog

View file

@ -21,11 +21,11 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from pysollib.ui.tktile.tkutil import makeToplevel, setTransient
from six.moves import tkinter
# ************************************************************************
# * a simple progress bar
# ************************************************************************

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import KwStruct, USE_PIL
from pysollib.mygettext import _
@ -31,8 +32,6 @@ from pysollib.ui.tktile.tkcanvas import MfxCanvasImage
from pysollib.ui.tktile.tkutil import loadImage
from pysollib.util import CARDSET
from six.moves import tkinter
from .selecttree import SelectDialogTreeCanvas
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
from .tkwidget import MfxDialog, MfxScrolledCanvas

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------
import os
import tkinter
from collections import UserList
from pysollib.gamedb import GI
@ -32,8 +33,6 @@ from pysollib.resource import CSI
from pysollib.ui.tktile.selecttree import SelectDialogTreeData
from pysollib.ui.tktile.tkutil import unbind_destroy
from six.moves import tkinter
from .selecttree import SelectDialogTreeCanvas
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
from .tkwidget import MfxDialog, MfxScrolledCanvas

View file

@ -21,12 +21,13 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.ui.tktile.selecttree import SelectDialogTreeData
from six.moves import tkinter, tkinter_colorchooser
from six.moves import tkinter_colorchooser
from .selecttree import SelectDialogTreeCanvas
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode

View file

@ -21,13 +21,13 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.tk.basetkmfxdialog import BaseTkMfxDialog
from pysollib.ui.tktile.solverdialog import BaseSolverDialog, solver_dialog
from six.moves import range, tkinter
# ************************************************************************
# *
# ************************************************************************

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
@ -29,8 +30,6 @@ from pysollib.pysolaudio import pysolsoundserver
from pysollib.settings import TITLE
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from six.moves import tkinter
from .tkwidget import MfxDialog, MfxMessageDialog
# ************************************************************************

View file

@ -23,12 +23,11 @@
import os
import sys
import tkinter
from pysollib.mygettext import _
from pysollib.settings import WIN_SYSTEM
from six.moves import tkinter
from .tkwidget import MfxTooltip
if __name__ == '__main__':

View file

@ -24,7 +24,7 @@
a couple of classes for implementing partial tabbed-page like behaviour
"""
from six.moves import tkinter
import tkinter
MYRIDGE, MYRAISED = tkinter.RAISED, tkinter.RIDGE
# MYRIDGE, MYRAISED = tkinter.RIDGE, tkinter.RAISED

View file

@ -21,12 +21,11 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from six.moves import tkinter
from .tkwidget import MfxDialog

View file

@ -23,13 +23,12 @@
import os
import sys
import tkinter
from pysollib.mfxutil import Struct
from pysollib.mygettext import _
from pysollib.ui.tktile.tkhtml import Base_HTMLViewer
from six.moves import tkinter
from .statusbar import HtmlStatusbar
from .tkwidget import MfxMessageDialog

View file

@ -23,6 +23,7 @@
import os
import time
import tkinter
from pysollib.mfxutil import KwStruct, kwdefault
from pysollib.mfxutil import format_time
@ -31,7 +32,6 @@ from pysollib.settings import TOP_TITLE
from pysollib.stats import ProgressionFormatter, PysolStatsFormatter
from pysollib.ui.tktile.tkutil import bind, loadImage
from six.moves import tkinter
from six.moves import tkinter_font
from .tkwidget import MfxDialog, MfxMessageDialog

View file

@ -22,11 +22,10 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.ui.tktile.tkutil import bind
from six.moves import tkinter
from .tkwidget import MfxScrolledCanvas

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------
import time
import tkinter
import traceback
from pysollib.mfxutil import KwStruct, destruct, kwdefault, openURL
@ -32,7 +33,6 @@ from pysollib.ui.tktile.tkutil import after, after_cancel
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
from pysollib.ui.tktile.tkutil import makeToplevel, setTransient
from six.moves import tkinter
from six.moves import tkinter_font
# ************************************************************************

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------##
import os
import tkinter
from pysollib.mfxutil import Image, ImageTk
from pysollib.mygettext import _, n_
@ -31,8 +32,6 @@ from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from pysollib.util import IMAGE_EXTENSIONS
from pysollib.winsystems import TkSettings
from six.moves import tkinter
from .tkwidget import MfxTooltip

View file

@ -21,13 +21,13 @@
#
# ---------------------------------------------------------------------------##
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from pysollib.wizardpresets import presets
from pysollib.wizardutil import WizardWidgets
from six.moves import tkinter
from .tabpage import TabPageSet
from .tkwidget import MfxDialog

View file

@ -1,9 +1,9 @@
# This module exports classes for the various canvas item types
# NOTE: This module was an experiment and is now obsolete.
# It's best to use the Tkinter.Canvas class directly.
# It's best to use the tkinter.Canvas class directly.
from six.moves.tkinter import Canvas, _cnfmerge, _flatten # noqa: F401
from tkinter import Canvas, _cnfmerge, _flatten # noqa: F401
class CanvasItem:

View file

@ -21,10 +21,11 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from six.moves import tkinter
from six.moves.tkinter_colorchooser import askcolor

View file

@ -1,8 +1,8 @@
import tkinter
from pysollib.mfxutil import KwStruct
from pysollib.mygettext import _
from six.moves import tkinter
class BaseEditTextDialog:
def __init__(self, parent, title, text, **kw):

View file

@ -22,6 +22,7 @@
# ---------------------------------------------------------------------------
import os
import tkinter
from pysollib.mygettext import _
from pysollib.resource import CSI
@ -31,8 +32,6 @@ from pysollib.ui.tktile.tkcanvas import MfxCanvasImage, MfxCanvasRectangle
from pysollib.ui.tktile.tkutil import after, after_cancel
from pysollib.ui.tktile.tkutil import bind, makeImage, unbind_destroy
from six.moves import tkinter
LARGE_EMBLEMS_SIZE = (38, 34)
SMALL_EMBLEMS_SIZE = (31, 21)

View file

@ -21,14 +21,14 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mygettext import _
from pysollib.settings import TITLE
from pysollib.ui.tktile.tkcanvas import MfxCanvas, MfxCanvasGroup
from pysollib.ui.tktile.tkcanvas import MfxCanvasImage
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
from six.moves import tkinter
class FullPictureDialog(tkinter.Toplevel):
CARD_IMAGES = {} # key: (type, rank, suit)

View file

@ -3,6 +3,7 @@ import os
import platform
import re
import sys
import tkinter
from pysollib.gamedb import GI
from pysollib.hint import PySolHintLayoutImportError
@ -17,7 +18,6 @@ from pysollib.ui.tktile.tkconst import EVENT_PROPAGATE
from pysollib.ui.tktile.tkconst import STATUSBAR_ITEMS, TOOLBAR_BUTTONS
from pysollib.ui.tktile.tkutil import after_idle, bind
from six.moves import tkinter
from six.moves import tkinter_tkfiledialog

View file

@ -1,9 +1,9 @@
import tkinter
from pysollib.mygettext import _
from pysollib.settings import TITLE
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
from six.moves import tkinter
class BaseSolverDialog:
def _ToggleShowProgressButton(self, *args):

View file

@ -21,13 +21,13 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.mfxutil import Image, ImageTk
from pysollib.ui.tktile.Canvas2 import CanvasText, Group, Line, Rectangle
from pysollib.ui.tktile.Canvas2 import ImageItem as ImageItem2
from pysollib.ui.tktile.tkutil import loadImage, unbind_destroy
from six.moves import tkinter
# ************************************************************************
# * canvas items

View file

@ -21,9 +21,9 @@
#
# ---------------------------------------------------------------------------##
from pysollib.mygettext import n_
import tkinter
from six.moves import tkinter
from pysollib.mygettext import n_
# ************************************************************************
# * constants

View file

@ -23,6 +23,7 @@
import os
import sys
import tkinter
import pysollib.formatter
import pysollib.htmllib2 as htmllib
@ -31,8 +32,6 @@ from pysollib.mygettext import _
from pysollib.settings import TITLE
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
from six.moves import tkinter
REMOTE_PROTOCOLS = ("ftp:", "gopher:", "http:", "https:", "mailto:", "news:",
"telnet:")

View file

@ -23,12 +23,12 @@
import os
import re
import tkinter
from pysollib.mfxutil import Image, ImageDraw, ImageOps, ImageTk, \
get_default_resampling
from pysollib.settings import TITLE, WIN_SYSTEM
from six.moves import tkinter
from six.moves import tkinter_font

View file

@ -21,9 +21,10 @@
#
# ---------------------------------------------------------------------------
import tkinter
from pysollib.ui.tktile.tkconst import EVENT_PROPAGATE
from six.moves import tkinter
TclError = tkinter.TclError

View file

@ -8,11 +8,11 @@
# Arrow up/down flip through the sets
import os
import tkinter
from glob import glob
from PIL import Image, ImageTk
from six.moves import tkinter
from six.moves import tkinter_tkfiledialog as filedialog # messagebox