Skip to content

Commit f360600

Browse files
authored
finish removing dependency on six (#403)
* finish removing dependency on six * fix tkinter.FileDialog * fix filedialog <> FileDialog
1 parent b3cdb7e commit f360600

32 files changed

+64
-89
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,18 @@ per the instructions above.
118118
At the moment, this only works on POSIX (Linux, FreeBSD and similar) systems.
119119
Windows and Mac users - you'll need to chip in with a script for your system.
120120

121-
#### 1 - Install build prerequisites: six and pysol-cards
121+
#### 1 - Install build prerequisite: pysol-cards
122122

123123
This is kind of stupid and maybe it can be fixed in the future, but for now:
124124

125125
```
126-
pip install six
127126
pip install pysol-cards
128127
```
129128

130129
You may want to use your OS distribution package system instead, for example:
131130

132131
```
133-
sudo apt-get install python3-six
132+
sudo apt-get install python3-pysol-cards
134133
```
135134

136135
For Pillow compilation, libjpeg headers and libraries need to be available:

pysollib/htmllib2.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
See the HTML 2.0 specification:
44
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
55
"""
6+
import html.parser as html_parser
67

78
from pysollib.formatter import AS_IS
89

9-
from six.moves import html_parser
10-
1110

1211
class HTMLParseError(RuntimeError):
1312
"""Error raised when an HTML document can't be parsed."""

pysollib/kivy/menubar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ def mOpen(self, *event):
20922092
idir, ifile = "", ""
20932093
if not idir:
20942094
idir = self.app.dn.savegames
2095-
# d = tkFileDialog.Open()
2095+
# d = tkinter.filedialog.Open()
20962096
# filename = d.show(filetypes=self.FILETYPES,
20972097
# defaultextension=self.DEFAULTEXTENSION,
20982098
# initialdir=idir, initialfile=ifile)

pysollib/tile/basetilemfxdialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from six.moves import tkinter_ttk as ttk
1+
import tkinter.ttk as ttk
22

33
from .tkwidget import MfxDialog
44

pysollib/tile/fontsdialog.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
# ---------------------------------------------------------------------------
2323

2424
import tkinter
25+
import tkinter.font
26+
import tkinter.ttk as ttk
2527

2628
from pysollib.mfxutil import KwStruct
2729
from pysollib.mygettext import _
2830
from pysollib.ui.tktile.tkutil import bind
2931

30-
from six.moves import tkinter_font
31-
from six.moves import tkinter_ttk as ttk
32-
3332
from .tkwidget import MfxDialog
3433
from .tkwidget import PysolScale
3534

@@ -109,7 +108,7 @@ def __init__(self, parent, title, init_font, **kw):
109108
command=self.fontupdate, variable=self.size_var)
110109
sc.grid(row=4, column=0, columnspan=2, sticky='news')
111110
#
112-
font_families = list(tkinter_font.families())
111+
font_families = list(tkinter.font.families())
113112
font_families.sort()
114113
selected = -1
115114
n = 0

pysollib/tile/menubar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#
2222
# ---------------------------------------------------------------------------##
2323

24+
import tkinter.ttk as ttk
25+
2426
from pysollib.mygettext import _, n_
2527
from pysollib.settings import TITLE
2628
from pysollib.ui.tktile.findcarddialog import connect_game_find_card_dialog
@@ -32,8 +34,6 @@
3234
from pysollib.ui.tktile.solverdialog import connect_game_solver_dialog
3335
from pysollib.util import CARDSET
3436

35-
from six.moves import tkinter_ttk as ttk
36-
3737
from .selectgame import SelectGameDialog, SelectGameDialogWithPreview
3838
from .selecttile import SelectTileDialogWithPreview
3939
from .soundoptionsdialog import SoundOptionsDialog

pysollib/tile/playeroptionsdialog.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
# ---------------------------------------------------------------------------##
2323

2424
import tkinter
25+
import tkinter.ttk as ttk
2526

2627
from pysollib.mfxutil import KwStruct
2728
from pysollib.mygettext import _
2829

29-
from six.moves import tkinter_ttk as ttk
30-
3130
from .tkwidget import MfxDialog
3231

3332

pysollib/tile/progressbar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
# ---------------------------------------------------------------------------
2323

2424
import tkinter
25+
import tkinter.ttk as ttk
2526

2627
from pysollib.ui.tktile.tkconst import EVENT_HANDLED
2728
from pysollib.ui.tktile.tkutil import makeToplevel, setTransient
2829

29-
from six.moves import tkinter_ttk as ttk
30-
3130
# ************************************************************************
3231
# * a simple progress bar
3332
# ************************************************************************

pysollib/tile/selectcardset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import os
2525
import tkinter
26+
import tkinter.ttk as ttk
2627

2728
from pysollib.mfxutil import KwStruct, USE_PIL
2829
from pysollib.mygettext import _
@@ -32,8 +33,6 @@
3233
from pysollib.ui.tktile.tkutil import bind, loadImage
3334
from pysollib.util import CARDSET
3435

35-
from six.moves import tkinter_ttk as ttk
36-
3736
from .selecttree import SelectDialogTreeCanvas
3837
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
3938
from .tkwidget import MfxDialog, MfxScrolledCanvas, PysolCombo, PysolScale

pysollib/tile/selectgame.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import os
2525
import tkinter
26+
import tkinter.ttk as ttk
2627
from collections import UserList
2728

2829
from pysollib.gamedb import GI
@@ -33,8 +34,6 @@
3334
from pysollib.ui.tktile.selecttree import SelectDialogTreeData
3435
from pysollib.ui.tktile.tkutil import bind, unbind_destroy
3536

36-
from six.moves import tkinter_ttk as ttk
37-
3837
from .selecttree import SelectDialogTreeCanvas
3938
from .selecttree import SelectDialogTreeLeaf, SelectDialogTreeNode
4039
from .tkwidget import MfxDialog, MfxScrolledCanvas, PysolCombo

0 commit comments

Comments
 (0)