tkinterweb-tkhtml 1.1.3__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/LICENSE.md +1 -1
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/PKG-INFO +3 -3
- tkinterweb-tkhtml-2.0.0/README.md +7 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/setup.py +1 -1
- tkinterweb-tkhtml-2.0.0/tkinterweb_tkhtml/__init__.py +140 -0
- tkinterweb-tkhtml-2.0.0/tkinterweb_tkhtml/tkhtml/manylinux1_x86_64/libTkhtml3.1.so +0 -0
- tkinterweb-tkhtml-2.0.0/tkinterweb_tkhtml/tkhtml/win_amd64/libTkhtml3.1.dll +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/PKG-INFO +3 -3
- tkinterweb-tkhtml-1.1.3/README.md +0 -7
- tkinterweb-tkhtml-1.1.3/tkinterweb_tkhtml/__init__.py +0 -142
- tkinterweb-tkhtml-1.1.3/tkinterweb_tkhtml/tkhtml/manylinux1_x86_64/libTkhtml3.1.so +0 -0
- tkinterweb-tkhtml-1.1.3/tkinterweb_tkhtml/tkhtml/win_amd64/libTkhtml3.1.dll +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/MANIFEST.in +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/setup.cfg +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/COPYRIGHT +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/linux_armv7l/libTkhtml3.0.so +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/macosx_10_6_x86_64/libTkhtml3.0.dylib +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/macosx_11_0_arm64/libTkhtml3.0.dylib +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/manylinux1_i686/libTkhtml3.0.so +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/manylinux1_x86_64/libTkhtml3.0.so +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/manylinux2014_aarch64/libTkhtml3.0.so +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/win32/libTkhtml3.0.dll +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/win_amd64/COPYING-CAIRO-LGPL-2.1 +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/win_amd64/libTkhtml3.0.dll +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/win_amd64/libcairo-2.dll +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/SOURCES.txt +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/dependency_links.txt +0 -0
- {tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tkinterweb-tkhtml
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: HTML/CSS viewer for Tkinter
|
|
5
5
|
Home-page: https://github.com/Andereoo/TkinterWeb-Tkhtml
|
|
6
6
|
License: MIT
|
|
@@ -18,8 +18,8 @@ License-File: LICENSE.md
|
|
|
18
18
|
|
|
19
19
|
# TkinterWeb-Tkhtml
|
|
20
20
|
|
|
21
|
-
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from
|
|
21
|
+
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from https://github.com/Andereoo/TkinterWeb-Tkhtml, which enables the display of styled HTML and CSS code in Tkinter applications.**
|
|
22
22
|
|
|
23
|
-
This package can be used to
|
|
23
|
+
This package can be used to load the Tkhtml widget into Tkinter applications but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
24
24
|
|
|
25
25
|
**See https://github.com/Andereoo/TkinterWeb for more information.**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# TkinterWeb-Tkhtml
|
|
2
|
+
|
|
3
|
+
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from https://github.com/Andereoo/TkinterWeb-Tkhtml, which enables the display of styled HTML and CSS code in Tkinter applications.**
|
|
4
|
+
|
|
5
|
+
This package can be used to load the Tkhtml widget into Tkinter applications but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
6
|
+
|
|
7
|
+
**See https://github.com/Andereoo/TkinterWeb for more information.**
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
TkinterWeb-Tkhtml v2.0
|
|
3
|
+
This package provides pre-built binaries of a modified version of the Tkhtml3 widget from https://github.com/Andereoo/TkinterWeb-Tkhtml,
|
|
4
|
+
which enables the display of styled HTML and CSS code in Tkinter applications.
|
|
5
|
+
|
|
6
|
+
If you are not using the compile script's --install option, to add a new Tkhtml version, use the following file naming conventions:
|
|
7
|
+
- For Tcl/Tk 8:
|
|
8
|
+
- For a standard release: libTkhtml[major_version.minor_version].[dll/dylib/so] (eg. libTkhtml3.0.dll)
|
|
9
|
+
- For an experimental release: libTkhtml[major_version.minor_version]exp.[dll/dylib/so] (eg. libTkhtml3.1exp.dll)
|
|
10
|
+
- For Tcl/Tk 9:
|
|
11
|
+
- For a standard release: libTkhtml[major_version.minor_version]-TclTk9.[dll/dylib/so] (eg. libTkhtml3.0-TclTk9.dll)
|
|
12
|
+
- For an experimental release: libTkhtml[major_version.minor_version]exp-TclTk9.[dll/dylib/so] (eg. libTkhtml3.1exp-TclTk9.dll)
|
|
13
|
+
|
|
14
|
+
This package can be used to load the Tkhtml widget into Tkinter applications.
|
|
15
|
+
but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
16
|
+
See https://github.com/Andereoo/TkinterWeb.
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2025 Andrew Clarke
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
import os
|
|
22
|
+
|
|
23
|
+
from tkinter import TclVersion
|
|
24
|
+
|
|
25
|
+
__title__ = 'TkinterWeb-Tkhtml'
|
|
26
|
+
__author__ = "Andrew Clarke"
|
|
27
|
+
__copyright__ = "Copyright (c) 2025 Andrew Clarke"
|
|
28
|
+
__license__ = "MIT"
|
|
29
|
+
__version__ = '2.0.0'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# --- Begin universal sdist ---------------------------------------------------
|
|
33
|
+
import sys
|
|
34
|
+
import platform
|
|
35
|
+
|
|
36
|
+
PLATFORM = platform.uname()
|
|
37
|
+
# --- End universal sdist -----------------------------------------------------
|
|
38
|
+
|
|
39
|
+
TKHTML_ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tkhtml")
|
|
40
|
+
|
|
41
|
+
# --- Begin universal sdist -----------------------------------------------------
|
|
42
|
+
if PLATFORM.system == "Linux":
|
|
43
|
+
if "arm" in PLATFORM.machine: # 32 bit arm Linux - Raspberry Pi and others
|
|
44
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "linux_armv71")
|
|
45
|
+
elif "aarch64" in PLATFORM.machine: # 64 bit arm Linux - Raspberry Pi and others
|
|
46
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux2014_aarch64")
|
|
47
|
+
elif sys.maxsize > 2**32: # 64 bit Linux
|
|
48
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux1_x86_64")
|
|
49
|
+
else: # 32 bit Linux
|
|
50
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux1_i686")
|
|
51
|
+
elif PLATFORM.system == "Darwin":
|
|
52
|
+
if "arm" in PLATFORM.machine: # M1 Mac
|
|
53
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "macosx_11_0_arm64")
|
|
54
|
+
else: # other Macs
|
|
55
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "macosx_10_6_x86_64")
|
|
56
|
+
else:
|
|
57
|
+
if sys.maxsize > 2**32: # 64 bit Windows
|
|
58
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "win_amd64")
|
|
59
|
+
else: # 32 bit Windows
|
|
60
|
+
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "win32")
|
|
61
|
+
# --- End universal sdist -----------------------------------------------------
|
|
62
|
+
|
|
63
|
+
ALL_TKHTML_BINARIES = [file for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file]
|
|
64
|
+
|
|
65
|
+
if TclVersion >= 9:
|
|
66
|
+
TKHTML_BINARIES = [file for file in ALL_TKHTML_BINARIES if "TclTk9" in file]
|
|
67
|
+
HELP_MESSAGE_EXP = f"Download https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/experimental and run 'python compile.py' to compile Tkhtml. \
|
|
68
|
+
Copy the binary into {TKHTML_ROOT_DIR}, adding 'exp-TclTk9' after the filename (eg. 'libTkhtml3.1exp-TclTk9.dll')"
|
|
69
|
+
else:
|
|
70
|
+
TKHTML_BINARIES = [file for file in ALL_TKHTML_BINARIES if "TclTk9" not in file]
|
|
71
|
+
HELP_MESSAGE_EXP = f"Download https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/experimental and run 'python compile.py' to compile Tkhtml. \
|
|
72
|
+
Copy the binary into {TKHTML_ROOT_DIR}, adding 'exp' after the filename (eg. 'libTkhtml3.1exp.dll')"
|
|
73
|
+
|
|
74
|
+
HELP_MESSAGE = f"Download https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/3.1-TclTk9 and run 'python compile.py --install' to compile and install Tkhtml. If you think this is a bug, consider filing a bug report."
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def get_tkhtml_file(version=None, index=-1, experimental=False):
|
|
78
|
+
"Get the location of the platform's Tkhtml binary"
|
|
79
|
+
if not TKHTML_BINARIES:
|
|
80
|
+
if ALL_TKHTML_BINARIES:
|
|
81
|
+
raise OSError(f"No Tkhtml versions could be found for Tcl/Tk {int(TclVersion)}. {HELP_MESSAGE}")
|
|
82
|
+
else:
|
|
83
|
+
raise OSError(f"No Tkhtml versions could be found for your system. {HELP_MESSAGE}")
|
|
84
|
+
|
|
85
|
+
if isinstance(version, float):
|
|
86
|
+
version = str(version)
|
|
87
|
+
if version:
|
|
88
|
+
for file in TKHTML_BINARIES:
|
|
89
|
+
if version in file:
|
|
90
|
+
# Note: experimental can be "auto"
|
|
91
|
+
if "exp" in file:
|
|
92
|
+
if not experimental:
|
|
93
|
+
raise OSError(f"Tkhtml version {version} is an experimental release but experimental mode is disabled. {HELP_MESSAGE_EXP}")
|
|
94
|
+
experimental = True
|
|
95
|
+
else:
|
|
96
|
+
if experimental == True:
|
|
97
|
+
raise OSError(f"Tkhtml version {version} is not an experimental release but experimental mode is enabled. {HELP_MESSAGE_EXP}")
|
|
98
|
+
experimental = False
|
|
99
|
+
return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
|
|
100
|
+
raise OSError(f"Tkhtml version {version} either does not exist or is unsupported on your system. {HELP_MESSAGE}")
|
|
101
|
+
else:
|
|
102
|
+
# Get highest numbered avaliable file if a version is not provided
|
|
103
|
+
if experimental == True:
|
|
104
|
+
files = [k for k in TKHTML_BINARIES if 'exp' in k]
|
|
105
|
+
if not files:
|
|
106
|
+
raise OSError(f"No experimental Tkhtml versions could be found on your system. {HELP_MESSAGE_EXP}")
|
|
107
|
+
elif not experimental:
|
|
108
|
+
files = [k for k in TKHTML_BINARIES if 'exp' not in k]
|
|
109
|
+
else:
|
|
110
|
+
files = TKHTML_BINARIES
|
|
111
|
+
file = sorted(files)[index]
|
|
112
|
+
if "exp" in file:
|
|
113
|
+
experimental = True
|
|
114
|
+
else:
|
|
115
|
+
experimental = False
|
|
116
|
+
version = file.replace("libTkhtml", "").replace("exp", "")
|
|
117
|
+
version = version[:version.rfind(".")]
|
|
118
|
+
return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def get_loaded_tkhtml_version(master):
|
|
122
|
+
"""Get the version of the loaded Tkhtml instance.
|
|
123
|
+
This will raise a TclError if Tkhtml is not loaded.
|
|
124
|
+
Only call load_tkhtml_file or load_tkhtml if this fails or if you know this will fail."""
|
|
125
|
+
return master.tk.call("package", "present", "Tkhtml")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def load_tkhtml_file(master, file):
|
|
129
|
+
"Load Tkhtml into the current Tcl/Tk instance"
|
|
130
|
+
if TKHTML_ROOT_DIR not in os.environ["PATH"].split(os.pathsep):
|
|
131
|
+
os.environ["PATH"] = os.pathsep.join([
|
|
132
|
+
TKHTML_ROOT_DIR,
|
|
133
|
+
os.environ["PATH"]
|
|
134
|
+
])
|
|
135
|
+
master.tk.call("load", file)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def load_tkhtml(master):
|
|
139
|
+
"Load Tkhtml into the current Tcl/Tk instance"
|
|
140
|
+
master.tk.call("package", "require", "Tkhtml")
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tkinterweb-tkhtml
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: HTML/CSS viewer for Tkinter
|
|
5
5
|
Home-page: https://github.com/Andereoo/TkinterWeb-Tkhtml
|
|
6
6
|
License: MIT
|
|
@@ -18,8 +18,8 @@ License-File: LICENSE.md
|
|
|
18
18
|
|
|
19
19
|
# TkinterWeb-Tkhtml
|
|
20
20
|
|
|
21
|
-
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from
|
|
21
|
+
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from https://github.com/Andereoo/TkinterWeb-Tkhtml, which enables the display of styled HTML and CSS code in Tkinter applications.**
|
|
22
22
|
|
|
23
|
-
This package can be used to
|
|
23
|
+
This package can be used to load the Tkhtml widget into Tkinter applications but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
24
24
|
|
|
25
25
|
**See https://github.com/Andereoo/TkinterWeb for more information.**
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# TkinterWeb-Tkhtml
|
|
2
|
-
|
|
3
|
-
**This package provides pre-built binaries of a modified version of the Tkhtml3 widget from http://tkhtml.tcl.tk, which enables the display of styled HTML and CSS code in Tkinter applications.**
|
|
4
|
-
|
|
5
|
-
This package can be used to import the Tkhtml widget into Tkinter projects but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
6
|
-
|
|
7
|
-
**See https://github.com/Andereoo/TkinterWeb for more information.**
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
TkinterWeb-Tkhtml v1.1
|
|
3
|
-
This package provides pre-built binaries of a modified version of the Tkhtml3 widget from http://tkhtml.tcl.tk/tkhtml.html,
|
|
4
|
-
which enables the display of styled HTML and CSS code in Tkinter applications.
|
|
5
|
-
|
|
6
|
-
This package can be used to import the Tkhtml widget into Tkinter projects
|
|
7
|
-
but is mainly intended to be used through TkinterWeb, which provides a full Python interface.
|
|
8
|
-
See https://github.com/Andereoo/TkinterWeb.
|
|
9
|
-
|
|
10
|
-
Copyright (c) 2025 Andereoo
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
import os
|
|
14
|
-
|
|
15
|
-
# Begin universal sdist
|
|
16
|
-
import sys
|
|
17
|
-
import platform
|
|
18
|
-
|
|
19
|
-
PLATFORM = platform.uname()
|
|
20
|
-
# End universal sdist
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__title__ = 'TkinterWeb-Tkhtml'
|
|
24
|
-
__author__ = "Andereoo"
|
|
25
|
-
__copyright__ = "Copyright (c) 2025 Andereoo"
|
|
26
|
-
__license__ = "MIT"
|
|
27
|
-
__version__ = '1.1.3'
|
|
28
|
-
|
|
29
|
-
TKHTML_RELEASE = "3.0 (TkinterWeb standard)" # Backwards-compatibility. Not useful or even necessarily true anymore. Will be removed.
|
|
30
|
-
|
|
31
|
-
TKHTML_ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tkhtml")
|
|
32
|
-
|
|
33
|
-
# Begin universal sdist
|
|
34
|
-
if PLATFORM.system == "Linux":
|
|
35
|
-
if "arm" in PLATFORM.machine: # 32 bit arm Linux - Raspberry Pi and others
|
|
36
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "linux_armv71")
|
|
37
|
-
elif "aarch64" in PLATFORM.machine: # 64 bit arm Linux - Raspberry Pi and others
|
|
38
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux2014_aarch64")
|
|
39
|
-
elif sys.maxsize > 2**32: # 64 bit Linux
|
|
40
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux1_x86_64")
|
|
41
|
-
else: # 32 bit Linux
|
|
42
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "manylinux1_i686")
|
|
43
|
-
elif PLATFORM.system == "Darwin":
|
|
44
|
-
if "arm" in PLATFORM.machine: # M1 Mac
|
|
45
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "macosx_11_0_arm64")
|
|
46
|
-
else: # other Macs
|
|
47
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "macosx_10_6_x86_64")
|
|
48
|
-
else:
|
|
49
|
-
if sys.maxsize > 2**32: # 64 bit Windows
|
|
50
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "win_amd64")
|
|
51
|
-
else: # 32 bit Windows
|
|
52
|
-
TKHTML_ROOT_DIR = os.path.join(TKHTML_ROOT_DIR, "win32")
|
|
53
|
-
# End universal sdist
|
|
54
|
-
|
|
55
|
-
TKHTML_BINARIES = [file for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file]
|
|
56
|
-
|
|
57
|
-
# NOTE:
|
|
58
|
-
# File names should be in the format libTkhtml[major].[minor].[so/dll/dylib]
|
|
59
|
-
# Experimental file names should be in the format libTkhtml[major].[minor]exp.[so/dll/dylib]
|
|
60
|
-
|
|
61
|
-
tkhtml_file = None
|
|
62
|
-
|
|
63
|
-
help_message = f"To add a new Tkhtml version, drop your binary into the {TKHTML_ROOT_DIR} folder, named using the following conventions:\n\
|
|
64
|
-
- For a standard release: libTkhtml[major_version.minor_version].[dll/dylib.so] (eg. libTkhtml3.0.dll)\n\
|
|
65
|
-
- For an experimental release: libTkhtml[major_version.minor_version]exp.[dll/dylib.so] (eg. libTkhtml3.1exp.dll)"
|
|
66
|
-
|
|
67
|
-
def get_tkhtml_folder():
|
|
68
|
-
# Backwards-compatibility. Will be removed.
|
|
69
|
-
return TKHTML_ROOT_DIR
|
|
70
|
-
|
|
71
|
-
def get_loaded_tkhtml_version():
|
|
72
|
-
global tkhtml_file
|
|
73
|
-
if tkhtml_file:
|
|
74
|
-
version = os.path.basename(tkhtml_file).replace("libTkhtml", "")
|
|
75
|
-
return version[:version.rfind(".")]
|
|
76
|
-
else:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
def get_tkhtml_file(version=None, index=-1, experimental=False):
|
|
80
|
-
"Get the location of the platform's Tkhtml binary"
|
|
81
|
-
if isinstance(version, float):
|
|
82
|
-
version = str(version)
|
|
83
|
-
if version:
|
|
84
|
-
for file in TKHTML_BINARIES:
|
|
85
|
-
if version in file:
|
|
86
|
-
# Note: experimental can be "auto"
|
|
87
|
-
if "exp" in file:
|
|
88
|
-
if not experimental:
|
|
89
|
-
raise OSError(f"Tkhtml version {version} is an experimental release but experimental mode is disabled. {help_message}")
|
|
90
|
-
experimental = True
|
|
91
|
-
else:
|
|
92
|
-
if experimental == True:
|
|
93
|
-
raise OSError(f"Tkhtml version {version} is not an experimental release but experimental mode is enabled. {help_message}")
|
|
94
|
-
experimental = False
|
|
95
|
-
return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
|
|
96
|
-
raise OSError(f"Tkhtml version {version} either does not exist or is unsupported on your system. {help_message}")
|
|
97
|
-
else:
|
|
98
|
-
# Get highest numbered avaliable file if a version is not provided
|
|
99
|
-
if experimental == True:
|
|
100
|
-
files = [k for k in TKHTML_BINARIES if 'exp' in k]
|
|
101
|
-
if not files:
|
|
102
|
-
raise OSError(f"No experimental Tkhtml versions could be found on your system. {help_message}")
|
|
103
|
-
elif not experimental:
|
|
104
|
-
files = [k for k in TKHTML_BINARIES if 'exp' not in k]
|
|
105
|
-
else:
|
|
106
|
-
files = TKHTML_BINARIES
|
|
107
|
-
file = sorted(files)[index]
|
|
108
|
-
if "exp" in file:
|
|
109
|
-
experimental = True
|
|
110
|
-
else:
|
|
111
|
-
experimental = False
|
|
112
|
-
version = file.replace("libTkhtml", "").replace("exp", "")
|
|
113
|
-
version = version[:version.rfind(".")]
|
|
114
|
-
return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def load_tkhtml_file(master, file, force=False):
|
|
118
|
-
"Load Tkhtml into the current Tcl/Tk instance"
|
|
119
|
-
global tkhtml_file
|
|
120
|
-
if (not tkhtml_file) or force:
|
|
121
|
-
if TKHTML_ROOT_DIR not in os.environ["PATH"].split(os.pathsep):
|
|
122
|
-
os.environ["PATH"] = os.pathsep.join([
|
|
123
|
-
TKHTML_ROOT_DIR,
|
|
124
|
-
os.environ["PATH"]
|
|
125
|
-
])
|
|
126
|
-
master.tk.call("load", file)
|
|
127
|
-
tkhtml_file = file
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def load_tkhtml(master, force=False, use_prebuilt=False):
|
|
131
|
-
"Load Tkhtml into the current Tcl/Tk instance"
|
|
132
|
-
if use_prebuilt:
|
|
133
|
-
# Backwards-compatibility. Will likely be removed.
|
|
134
|
-
file, version, experimental = get_tkhtml_file(None, 0)
|
|
135
|
-
load_tkhtml_file(master, file, force)
|
|
136
|
-
return version
|
|
137
|
-
|
|
138
|
-
global tkhtml_file
|
|
139
|
-
if (not tkhtml_file) or force:
|
|
140
|
-
master.tk.call("package", "require", "Tkhtml")
|
|
141
|
-
tkhtml_file = True
|
|
142
|
-
return master.tk.call("package", "present", "Tkhtml")
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml/tkhtml/win32/libTkhtml3.0.dll
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{tkinterweb-tkhtml-1.1.3 → tkinterweb-tkhtml-2.0.0}/tkinterweb_tkhtml.egg-info/top_level.txt
RENAMED
|
File without changes
|