tkinterweb 4.17.4__tar.gz → 4.17.6__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.
Files changed (23) hide show
  1. {tkinterweb-4.17.4/tkinterweb.egg-info → tkinterweb-4.17.6}/PKG-INFO +1 -1
  2. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/setup.py +1 -1
  3. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/bindings.py +17 -17
  4. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/handlers.py +5 -5
  5. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/htmlwidgets.py +8 -11
  6. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/utilities.py +1 -1
  7. {tkinterweb-4.17.4 → tkinterweb-4.17.6/tkinterweb.egg-info}/PKG-INFO +1 -1
  8. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/LICENSE.md +0 -0
  9. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/MANIFEST.in +0 -0
  10. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/README.md +0 -0
  11. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/setup.cfg +0 -0
  12. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/__init__.py +0 -0
  13. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/dom.py +0 -0
  14. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/extensions.py +0 -0
  15. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/imageutils.py +0 -0
  16. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/js.py +0 -0
  17. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/resources/combobox-2.3.tm +0 -0
  18. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/resources/pkgIndex.tcl +0 -0
  19. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb/subwidgets.py +0 -0
  20. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb.egg-info/SOURCES.txt +0 -0
  21. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb.egg-info/dependency_links.txt +0 -0
  22. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb.egg-info/requires.txt +0 -0
  23. {tkinterweb-4.17.4 → tkinterweb-4.17.6}/tkinterweb.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkinterweb
3
- Version: 4.17.4
3
+ Version: 4.17.6
4
4
  Summary: HTML/CSS viewer, editor, and app builder for Tkinter
5
5
  Home-page: https://github.com/Andereoo/TkinterWeb
6
6
  License: MIT
@@ -6,7 +6,7 @@ README = (HERE / "README.md").read_text()
6
6
 
7
7
  setup(
8
8
  name="tkinterweb",
9
- version="4.17.4",
9
+ version="4.17.6",
10
10
  python_requires=">=3.2",
11
11
  description="HTML/CSS viewer, editor, and app builder for Tkinter",
12
12
  long_description=README,
@@ -584,7 +584,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
584
584
  # --- HTML/CSS parsing ----------------------------------------------------
585
585
 
586
586
  def parse(self, html, thread_safe=False):
587
- "Parse HTML code. reset() must be called before running parse() for the first time."
587
+ "Parse HTML code. Call :meth:`TkinterWeb.reset` before calling this method for the first time."
588
588
  # NOTE: when thread_safe=True, this method is thread-safe
589
589
 
590
590
  self.downloads_have_occured = False
@@ -737,15 +737,15 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
737
737
  thread.start()
738
738
 
739
739
  def _begin_download(self):
740
- # NOTE: this runs in a thread
740
+ # NOTE: this may run in a thread
741
741
 
742
742
  thread = utilities.get_current_thread()
743
743
  self.active_threads.append(thread)
744
- self.post_event(utilities.DOWNLOADING_RESOURCE_EVENT, True)
744
+ self.post_event(utilities.DOWNLOADING_RESOURCE_EVENT, thread.is_subthread)
745
745
  return thread
746
746
 
747
747
  def _finish_download(self, thread):
748
- # NOTE: this runs in a thread
748
+ # NOTE: this may run in a thread
749
749
 
750
750
  self.active_threads.remove(thread)
751
751
  if len(self.active_threads) == 0:
@@ -769,20 +769,20 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
769
769
  else:
770
770
  return None, None
771
771
 
772
- def text(self, *args):
773
- "Enable interaction with the text of the HTML document."
774
- return self.tk.call(self._w, "text", *args)
772
+ def text(self, subcommand, *args):
773
+ "Interact with the text of the HTML document. Valid subcommands are bbox, index, offset, and text."
774
+ return self.tk.call(self._w, "text", subcommand, *args)
775
775
 
776
776
  def tag(self, subcommand, tag_name, *args):
777
- "Return the name of the Html tag that generated this document node, or an empty string if the node is a text node."
777
+ "Highlight regions of text displayed by the widget. Valid subcommands are add, remove, configure, and delete."
778
778
  return self.tk.call(self._w, "tag", subcommand, tag_name, *args)
779
779
 
780
780
  def search(self, selector, *a, cnf={}, **kw):
781
- """Search the document for the specified CSS selector; return a Tkhtml3 node if found."""
781
+ """Search the document for the specified CSS selector; return a Tkhtml node if found."""
782
782
  return self.tk.call((self._w, "search", selector)+utilities.TclOpt(a)+self._options(cnf, kw))
783
783
 
784
784
  def xview(self, *args, auto_scroll=False):
785
- "Used to control horizontal scrolling."
785
+ "Control horizontal scrolling."
786
786
  #if args:
787
787
  # return self.tk.call(self._w, "xview", *args)
788
788
  #coords = map(float, self.tk.call(self._w, "xview").split()) #raises an error
@@ -802,7 +802,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
802
802
  return self.xview("moveto", number, auto_scroll=auto_scroll)
803
803
 
804
804
  def yview(self, *args, auto_scroll=False):
805
- """Used to control vertical scrolling."""
805
+ """Control vertical scrolling."""
806
806
  yview = self.tk.call(self._w, "yview", *args)
807
807
  if args:
808
808
  self.caret_manager.update(auto_scroll=auto_scroll)
@@ -970,11 +970,11 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
970
970
  self.tk.call(node, "dynamic", "set", name)
971
971
 
972
972
  def remove_node_flags(self, node, name):
973
- "Set dynamic flags on the given node."
973
+ "remove dynamic flags on the given node."
974
974
  self.tk.call(node, "dynamic", "clear", name)
975
975
 
976
976
  def get_node_tkhtml(self, node_handle):
977
- "Get the path name of node."
977
+ "Get the path name of the node's corresponding Tkhtml instance."
978
978
  return self.tk.call(node_handle, "html")
979
979
 
980
980
  def get_node_stacking(self, node_handle):
@@ -985,7 +985,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
985
985
  return self.tk.call(node_handle, "stacking")
986
986
 
987
987
  def get_current_hovered_node(self, event):
988
- "Get current node."
988
+ "Get the current node."
989
989
  if self.widget_manager.hovered_embedded_node:
990
990
  return self.widget_manager.hovered_embedded_node
991
991
 
@@ -994,11 +994,11 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
994
994
  )
995
995
 
996
996
  def get_current_hovered_node_parent(self, node):
997
- "Get the parent of the given node."
997
+ "Get the parent of the node returned by :meth:`TkinterWeb.get_current_hovered_node`."
998
998
  return self.tk.eval(f"""set node [lindex [lindex [{node} parent] end] end]""")
999
999
 
1000
1000
  def register_handler(self, handler_type, node_tag, callback):
1001
- "Register a node handler"
1001
+ "Register a node handler."
1002
1002
  self.tk.call(self._w, "handler", handler_type, node_tag, self.register(callback))
1003
1003
 
1004
1004
  def _lazy_handler(self, manager, method):
@@ -1008,7 +1008,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
1008
1008
  return callback
1009
1009
 
1010
1010
  def register_lazy_handler(self, handler_type, node_tag, manager_name):
1011
- "Register a node handler to run in the given manager"
1011
+ "Register a node handler to run lazily in the given manager."
1012
1012
  if handler_type == "attribute":
1013
1013
  callback_name = f"_on_{node_tag}_value_change"
1014
1014
  else:
@@ -479,7 +479,7 @@ class ScriptManager(utilities.BaseManager):
479
479
 
480
480
  def fetch_scripts(self, attributes, url=None, data=None):
481
481
  "Fetch and run scripts"
482
- # NOTE: this runs in a thread
482
+ # NOTE: this may run in a thread
483
483
 
484
484
  thread = self.html._begin_download()
485
485
 
@@ -563,7 +563,7 @@ class StyleManager(utilities.BaseManager):
563
563
 
564
564
  def fetch_styles(self, url=None, node=None):
565
565
  "Fetch stylesheets and parse the CSS code they contain"
566
- # NOTE: this runs in a thread
566
+ # NOTE: this may run in a thread
567
567
 
568
568
  thread = self.html._begin_download()
569
569
  if url and thread.isrunning():
@@ -692,7 +692,7 @@ class ImageManager(utilities.BaseManager):
692
692
 
693
693
  def fetch_images(self, url, name):
694
694
  "Fetch images and display them in the document."
695
- # NOTE: this runs in a thread
695
+ # NOTE: this may run in a thread
696
696
 
697
697
  thread = self.html._begin_download()
698
698
  if thread.isrunning():
@@ -717,7 +717,7 @@ class ImageManager(utilities.BaseManager):
717
717
 
718
718
  def check_images(self, data, name, url, filetype, thread_safe):
719
719
  "Invert images if needed and convert SVG images to PNGs."
720
- # NOTE: this runs in a thread
720
+ # NOTE: this may run in a thread
721
721
 
722
722
  data_is_image = False
723
723
  if "svg" in filetype:
@@ -899,7 +899,7 @@ class ObjectManager(utilities.BaseManager):
899
899
  self.html.widget_manager.map_node(node, True)
900
900
 
901
901
  def fetch_objects(self, url, node):
902
- # NOTE: this runs in a thread
902
+ # NOTE: this may run in a thread
903
903
 
904
904
  thread = self.html._begin_download()
905
905
 
@@ -1106,6 +1106,9 @@ class HtmlFrame(Frame):
1106
1106
  """Make all elements with the 'tkinterweb-full-page' attribute the same height as the html widget.
1107
1107
  This can be used in conjunction with table elements to vertical align pages,
1108
1108
  which is otherwise not possible with Tkhtml. Hopefully we won't need this forever."""
1109
+ if self._html.cget("shrink"):
1110
+ return
1111
+
1109
1112
  if event:
1110
1113
  height = event.height
1111
1114
  else:
@@ -1187,7 +1190,7 @@ class HtmlFrame(Frame):
1187
1190
 
1188
1191
  def _continue_loading(self, url, data="", method="GET", decode=None, force=False, thread_safe=False):
1189
1192
  "Finish loading urls and handle URI fragments."
1190
- # NOTE: this runs in a thread
1193
+ # NOTE: this may run in a thread
1191
1194
 
1192
1195
  code = 404
1193
1196
  self._current_url = url
@@ -1422,18 +1425,12 @@ class HtmlLabel(HtmlFrame):
1422
1425
 
1423
1426
  self._style = Style()
1424
1427
 
1425
- if text:
1426
- self.load_html(text)
1427
- # I'd like to just make this an else statement
1428
- # But someone in issue 145 mentioned layout issues when that was the case
1429
- # I can't seem to reproduce it though...?
1428
+ if text: self.load_html(text)
1429
+ # I'd like to just make this an else statement to prevent the widget from being a massive white screen when text=""
1430
1430
  elif self.unshrink or (not self._html.using_tkhtml30 and not self._html.cget("textwrap")):
1431
+ # A fellow in issue 145 mentioned layout issues when this was used
1432
+ # I can't seem to reproduce it though...?
1431
1433
  self.load_html("<body></body>", _relayout=False)
1432
-
1433
- def _handle_html_resize(self, *args, **kwargs):
1434
- # Overwrite HtmlFrame._handle_html_resize, which is not necessary when shrink is set to True
1435
- # HtmlFrame._handle_html_resize also causes weird behaviour when tables are present and shrink set to True
1436
- return
1437
1434
 
1438
1435
  def load_html(self, *args, _relayout=True, **kwargs):
1439
1436
  ""
@@ -31,7 +31,7 @@ __title__ = "TkinterWeb"
31
31
  __author__ = "Andrew Clarke"
32
32
  __copyright__ = "(c) 2021-2025 Andrew Clarke"
33
33
  __license__ = "MIT"
34
- __version__ = "4.17.4"
34
+ __version__ = "4.17.6"
35
35
 
36
36
 
37
37
  ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "resources")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkinterweb
3
- Version: 4.17.4
3
+ Version: 4.17.6
4
4
  Summary: HTML/CSS viewer, editor, and app builder for Tkinter
5
5
  Home-page: https://github.com/Andereoo/TkinterWeb
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes