tkinterweb-tkhtml 2.0.0__py3-none-linux_armv7l.whl → 2.1.0__py3-none-linux_armv7l.whl

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.
@@ -1,5 +1,5 @@
1
1
  """
2
- TkinterWeb-Tkhtml v2.0
2
+ TkinterWeb-Tkhtml v2.1
3
3
  This package provides pre-built binaries of a modified version of the Tkhtml3 widget from https://github.com/Andereoo/TkinterWeb-Tkhtml,
4
4
  which enables the display of styled HTML and CSS code in Tkinter applications.
5
5
 
@@ -26,19 +26,28 @@ __title__ = 'TkinterWeb-Tkhtml'
26
26
  __author__ = "Andrew Clarke"
27
27
  __copyright__ = "Copyright (c) 2025 Andrew Clarke"
28
28
  __license__ = "MIT"
29
- __version__ = '2.0.0'
29
+ __version__ = '2.1.0'
30
30
 
31
31
 
32
32
  TKHTML_ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "tkhtml")
33
33
 
34
- ALL_TKHTML_BINARIES = [file for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file]
34
+ try:
35
+ from tkinterweb_tkhtml_extras import TKHTML_EXTRAS_ROOT_DIR
36
+ if TKHTML_EXTRAS_ROOT_DIR == None:
37
+ ALL_TKHTML_BINARIES = [[TKHTML_ROOT_DIR, file] for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file]
38
+ else:
39
+ ALL_TKHTML_BINARIES = [[TKHTML_ROOT_DIR, file] for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file] + \
40
+ [[TKHTML_EXTRAS_ROOT_DIR, file] for file in os.listdir(TKHTML_EXTRAS_ROOT_DIR) if "libTkhtml" in file]
41
+ except (ImportError, ModuleNotFoundError,):
42
+ TKHTML_EXTRAS_ROOT_DIR = None
43
+ ALL_TKHTML_BINARIES = [[TKHTML_ROOT_DIR, file] for file in os.listdir(TKHTML_ROOT_DIR) if "libTkhtml" in file]
35
44
 
36
45
  if TclVersion >= 9:
37
- TKHTML_BINARIES = [file for file in ALL_TKHTML_BINARIES if "TclTk9" in file]
46
+ TKHTML_BINARIES = [[loc, file] for loc, file in ALL_TKHTML_BINARIES if "TclTk9" in file]
38
47
  HELP_MESSAGE_EXP = f"Download https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/experimental and run 'python compile.py' to compile Tkhtml. \
39
48
  Copy the binary into {TKHTML_ROOT_DIR}, adding 'exp-TclTk9' after the filename (eg. 'libTkhtml3.1exp-TclTk9.dll')"
40
49
  else:
41
- TKHTML_BINARIES = [file for file in ALL_TKHTML_BINARIES if "TclTk9" not in file]
50
+ TKHTML_BINARIES = [[loc, file] for loc, file in ALL_TKHTML_BINARIES if "TclTk9" not in file]
42
51
  HELP_MESSAGE_EXP = f"Download https://github.com/Andereoo/TkinterWeb-Tkhtml/tree/experimental and run 'python compile.py' to compile Tkhtml. \
43
52
  Copy the binary into {TKHTML_ROOT_DIR}, adding 'exp' after the filename (eg. 'libTkhtml3.1exp.dll')"
44
53
 
@@ -56,7 +65,7 @@ def get_tkhtml_file(version=None, index=-1, experimental=False):
56
65
  if isinstance(version, float):
57
66
  version = str(version)
58
67
  if version:
59
- for file in TKHTML_BINARIES:
68
+ for loc, file in TKHTML_BINARIES:
60
69
  if version in file:
61
70
  # Note: experimental can be "auto"
62
71
  if "exp" in file:
@@ -67,7 +76,7 @@ def get_tkhtml_file(version=None, index=-1, experimental=False):
67
76
  if experimental == True:
68
77
  raise OSError(f"Tkhtml version {version} is not an experimental release but experimental mode is enabled. {HELP_MESSAGE_EXP}")
69
78
  experimental = False
70
- return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
79
+ return os.path.join(loc, file), version, experimental
71
80
  raise OSError(f"Tkhtml version {version} either does not exist or is unsupported on your system. {HELP_MESSAGE}")
72
81
  else:
73
82
  # Get highest numbered avaliable file if a version is not provided
@@ -79,14 +88,14 @@ def get_tkhtml_file(version=None, index=-1, experimental=False):
79
88
  files = [k for k in TKHTML_BINARIES if 'exp' not in k]
80
89
  else:
81
90
  files = TKHTML_BINARIES
82
- file = sorted(files)[index]
91
+ loc, file = sorted(files)[index]
83
92
  if "exp" in file:
84
93
  experimental = True
85
94
  else:
86
95
  experimental = False
87
96
  version = file.replace("libTkhtml", "").replace("exp", "")
88
97
  version = version[:version.rfind(".")]
89
- return os.path.join(TKHTML_ROOT_DIR, file), version, experimental
98
+ return os.path.join(loc, file), version, experimental
90
99
 
91
100
 
92
101
  def get_loaded_tkhtml_version(master):
@@ -98,11 +107,11 @@ def get_loaded_tkhtml_version(master):
98
107
 
99
108
  def load_tkhtml_file(master, file):
100
109
  "Load Tkhtml into the current Tcl/Tk instance"
101
- if TKHTML_ROOT_DIR not in os.environ["PATH"].split(os.pathsep):
102
- os.environ["PATH"] = os.pathsep.join([
103
- TKHTML_ROOT_DIR,
104
- os.environ["PATH"]
105
- ])
110
+ paths = os.environ["PATH"].split(os.pathsep)
111
+ for path in (TKHTML_ROOT_DIR, TKHTML_EXTRAS_ROOT_DIR):
112
+ if path and path not in paths:
113
+ paths.insert(0, path)
114
+ os.environ["PATH"] = os.pathsep.join(paths)
106
115
  master.tk.call("load", file)
107
116
 
108
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkinterweb-tkhtml
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: HTML/CSS viewer for Tkinter
5
5
  Home-page: https://github.com/Andereoo/TkinterWeb-Tkhtml
6
6
  License: MIT
@@ -0,0 +1,8 @@
1
+ tkinterweb_tkhtml/__init__.py,sha256=FegmuZXZYVYHIhPPI3UEuP3t9hKUSad9PZMHhzhg5WY,5956
2
+ tkinterweb_tkhtml/tkhtml/COPYRIGHT,sha256=DTaLs2-wF2uscyoCSsLB1oOqXwhtLRVZW1EdLa77OMs,1622
3
+ tkinterweb_tkhtml/tkhtml/libTkhtml3.0.so,sha256=7SLetf_4DXwz_iphlIRAvuuDnm6qYcfAdjVnnapfekc,310504
4
+ tkinterweb_tkhtml-2.1.0.dist-info/LICENSE.md,sha256=-PeosTLMUn2PEQ5Q12HUqYH4n_gjoKVxd107WE7BcMQ,1069
5
+ tkinterweb_tkhtml-2.1.0.dist-info/METADATA,sha256=mHABLscCqrleD4-QDF8m7wbu2S-9-lSJDNU3qj9fChk,1104
6
+ tkinterweb_tkhtml-2.1.0.dist-info/WHEEL,sha256=SfWbrUo49UCeTn4ZCaOubJz9Wtdk5gtBke9gOM6rnWs,101
7
+ tkinterweb_tkhtml-2.1.0.dist-info/top_level.txt,sha256=ZsOj9XY_g_0oGsUoDORlQhP0qdbT4X_Ts6yyFWG7i1A,18
8
+ tkinterweb_tkhtml-2.1.0.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- tkinterweb_tkhtml/__init__.py,sha256=5rF4HJECZfAPddakqQVvDiHsyIAVQQHYSAOfJDlr2CQ,5309
2
- tkinterweb_tkhtml/tkhtml/COPYRIGHT,sha256=DTaLs2-wF2uscyoCSsLB1oOqXwhtLRVZW1EdLa77OMs,1622
3
- tkinterweb_tkhtml/tkhtml/libTkhtml3.0.so,sha256=7SLetf_4DXwz_iphlIRAvuuDnm6qYcfAdjVnnapfekc,310504
4
- tkinterweb_tkhtml-2.0.0.dist-info/LICENSE.md,sha256=-PeosTLMUn2PEQ5Q12HUqYH4n_gjoKVxd107WE7BcMQ,1069
5
- tkinterweb_tkhtml-2.0.0.dist-info/METADATA,sha256=Miq4LD-_2rLQ8wzahNhJt5xnz8qriKQ4FA-90Fkd0qI,1104
6
- tkinterweb_tkhtml-2.0.0.dist-info/WHEEL,sha256=SfWbrUo49UCeTn4ZCaOubJz9Wtdk5gtBke9gOM6rnWs,101
7
- tkinterweb_tkhtml-2.0.0.dist-info/top_level.txt,sha256=ZsOj9XY_g_0oGsUoDORlQhP0qdbT4X_Ts6yyFWG7i1A,18
8
- tkinterweb_tkhtml-2.0.0.dist-info/RECORD,,