tksheet 7.5.11__py3-none-any.whl → 7.5.12__py3-none-any.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.
tksheet/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
  tksheet - A Python tkinter table widget
5
5
  """
6
6
 
7
- __version__ = "7.5.11"
7
+ __version__ = "7.5.12"
8
8
 
9
9
  from .colors import (
10
10
  color_map,
tksheet/sheet.py CHANGED
@@ -4670,51 +4670,52 @@ class Sheet(tk.Frame):
4670
4670
  deselect_all=False,
4671
4671
  data_indexes=True,
4672
4672
  )
4673
- open_ids = set(filter(self.exists, open_ids))
4674
4673
  self.RI.tree_open_ids = set()
4675
- if open_ids:
4676
- self.show_rows(
4677
- rows=self._tree_open(open_ids),
4678
- redraw=False,
4679
- deselect_all=False,
4680
- )
4674
+ open_ids = filter(self.exists, open_ids)
4675
+ try:
4676
+ first_id = next(open_ids)
4677
+ except StopIteration:
4678
+ return self.set_refresh_timer()
4679
+ self.show_rows(
4680
+ rows=self._tree_open(chain((first_id,), open_ids)),
4681
+ redraw=False,
4682
+ deselect_all=False,
4683
+ )
4681
4684
  return self.set_refresh_timer()
4682
4685
 
4683
- def _tree_open(self, items: set[str]) -> list[int]:
4686
+ def _tree_open(self, items: Iterator[str]) -> Generator[int]:
4684
4687
  """
4685
4688
  Only meant for internal use
4686
4689
  """
4687
- to_open = []
4688
4690
  disp_set = set(self.MT.displayed_rows)
4689
4691
  index = self.MT._row_index
4690
4692
  rns = self.RI.rns
4691
4693
  open_ids = self.RI.tree_open_ids
4692
4694
  descendants = self.RI.get_iid_descendants
4693
- for item in filter(items.__contains__, self.get_children()):
4694
- if index[rns[item]].children:
4695
+ for item in items:
4696
+ if item in rns and index[rns[item]].children:
4695
4697
  open_ids.add(item)
4696
4698
  if rns[item] in disp_set:
4697
4699
  for did in descendants(item, check_open=True):
4698
4700
  disp_set.add(rns[did])
4699
- to_open.append(rns[did])
4700
- return to_open
4701
+ yield rns[did]
4701
4702
 
4702
- def tree_open(self, *items, redraw: bool = True) -> Sheet:
4703
+ def tree_open(self, *items: str, redraw: bool = True) -> Sheet:
4703
4704
  """
4704
4705
  If used without args all items are opened
4705
4706
  """
4706
- to_open = self._tree_open(items) if (items := set(unpack(items))) else self._tree_open(set(self.get_children()))
4707
+ to_show = self._tree_open(items) if (items := set(unpack(items))) else self._tree_open(self.get_children())
4707
4708
  return self.show_rows(
4708
- rows=to_open,
4709
+ rows=to_show,
4709
4710
  redraw=redraw,
4710
4711
  deselect_all=False,
4711
4712
  )
4712
4713
 
4713
- def _tree_close(self, items: Iterator[str]) -> list[int]:
4714
+ def _tree_close(self, items: Iterator[str]) -> set[int]:
4714
4715
  """
4715
4716
  Only meant for internal use
4716
4717
  """
4717
- to_close = set()
4718
+ to_hide = set()
4718
4719
  disp_set = set(self.MT.displayed_rows)
4719
4720
  index = self.MT._row_index
4720
4721
  rns = self.RI.rns
@@ -4725,16 +4726,16 @@ class Sheet(tk.Frame):
4725
4726
  open_ids.discard(item)
4726
4727
  if rns[item] in disp_set:
4727
4728
  for did in descendants(item, check_open=True):
4728
- to_close.add(rns[did])
4729
- return to_close
4729
+ to_hide.add(rns[did])
4730
+ return to_hide
4730
4731
 
4731
- def tree_close(self, *items, redraw: bool = True) -> Sheet:
4732
+ def tree_close(self, *items: str, redraw: bool = True) -> Sheet:
4732
4733
  """
4733
4734
  If used without args all items are closed
4734
4735
  """
4735
- to_close = self._tree_close(unpack(items)) if items else self._tree_close(self.get_children())
4736
+ to_hide = self._tree_close(unpack(items)) if items else self._tree_close(self.get_children())
4736
4737
  return self.hide_rows(
4737
- rows=to_close,
4738
+ rows=to_hide,
4738
4739
  redraw=redraw,
4739
4740
  deselect_all=False,
4740
4741
  data_indexes=True,
@@ -5110,7 +5111,7 @@ class Sheet(tk.Frame):
5110
5111
  """
5111
5112
  if not self.item_displayed(item) and self.RI.iid_parent(item):
5112
5113
  self.show_rows(
5113
- rows=self._tree_open(list(self.RI.get_iid_ancestors(item))),
5114
+ rows=self._tree_open(self.RI.get_iid_ancestors(item)),
5114
5115
  redraw=False,
5115
5116
  deselect_all=False,
5116
5117
  )
@@ -5155,11 +5156,11 @@ class Sheet(tk.Frame):
5155
5156
  return self.set_refresh_timer(redraw)
5156
5157
 
5157
5158
  def selection_add(self, *items, run_binding: bool = True, redraw: bool = True) -> Sheet:
5158
- to_open = []
5159
+ to_open = set()
5159
5160
  quick_displayed_check = set(self.MT.displayed_rows)
5160
5161
  for item in filter(self.RI.rns.__contains__, unpack(items)):
5161
5162
  if self.RI.rns[item] not in quick_displayed_check and self.RI.iid_parent(item):
5162
- to_open.extend(list(self.RI.get_iid_ancestors(item)))
5163
+ to_open.update(self.RI.get_iid_ancestors(item))
5163
5164
  if to_open:
5164
5165
  self.show_rows(
5165
5166
  rows=self._tree_open(to_open),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tksheet
3
- Version: 7.5.11
3
+ Version: 7.5.12
4
4
  Summary: Tkinter table / sheet and treeview widget
5
5
  Author-email: ragardner <github@ragardner.simplelogin.com>
6
6
  License: Copyright (c) 2019 ragardner and open source contributors
@@ -77,6 +77,8 @@ Dynamic: license-file
77
77
 
78
78
  [![GitHub Release Date](https://img.shields.io/github/release-date-pre/ragardner/tksheet.svg)](https://github.com/ragardner/tksheet/releases) [![Downloads](https://img.shields.io/pypi/dm/tksheet.svg)](https://pypi.org/project/tksheet/)
79
79
 
80
+ With apologies, development of this library has ceased except for bug fixes or behavioral issues. Pull requests for other changes are unlikely to be merged.
81
+
80
82
  <table>
81
83
  <thead>
82
84
  <tr>
@@ -95,14 +97,11 @@ Dynamic: license-file
95
97
  <tr>
96
98
  <td align="right" colspan="2"><a href="https://github.com/ragardner/tksheet/blob/master/docs/CHANGELOG.md" target="_blank">Changelog</a></td>
97
99
  </tr>
98
- <tr>
99
- <td align="right" colspan="2"><a href="https://github.com/ragardner/tksheet/wiki/Version-7#asking-questions" target="_blank">Questions</a></td>
100
- </tr>
101
100
  <tr>
102
101
  <td align="right" colspan="2"><a href="https://github.com/ragardner/tksheet/wiki/Version-7#issues" target="_blank">Issues</a></td>
103
102
  </tr>
104
103
  <tr>
105
- <td align="right" colspan="2"><a href="https://github.com/ragardner/tksheet/wiki/Version-7#enhancements-or-suggestions" target="_blank">Suggestions and Contributors</a></td>
104
+ <td align="right" colspan="2"><a href="https://github.com/ragardner/tksheet/wiki/Version-7#contributions-and-special-thanks" target="_blank">Contributions and Thanks</a></td>
106
105
  </tr>
107
106
  </tbody>
108
107
  </table>
@@ -1,4 +1,4 @@
1
- tksheet/__init__.py,sha256=1cXEGG5mehmOt-iplRAfFOHJ4B_QhcbT1ulR_g7lc-o,2533
1
+ tksheet/__init__.py,sha256=fD70jpRTugB9VWfpt6BManIsp4vrlXl9UK5RU74jmYc,2533
2
2
  tksheet/colors.py,sha256=dHhmdFuQDlwohDHsAfT9VdrKoSl_R33L72a3HCin5zo,51591
3
3
  tksheet/column_headers.py,sha256=CkJBfgLu3qcXDJWhYT8mWniH81kMDeWsqcCoRko_FHo,111362
4
4
  tksheet/constants.py,sha256=4cpU_PmOgN0isBVPWwCwBwqD8Fxnu4HJgDSSjfxjiPo,25467
@@ -9,7 +9,7 @@ tksheet/main_table.py,sha256=XeonBS6BeuVb057TAbvphcULWPTL0mkTqLMVWLeXPh4,369093
9
9
  tksheet/menus.py,sha256=sRHZRgnYWddBtlzvbyWFSN2cVhlmUWyA9zf4vpqun7I,19431
10
10
  tksheet/other_classes.py,sha256=6LpexHAxj23ZweuL3a4yCcdMSj_iXP38S7WRNQAehe0,18354
11
11
  tksheet/row_index.py,sha256=RG9Z59ssefTVFmOR_kuu5LiUlRcSz1vO6KhM1pIWUYo,147530
12
- tksheet/sheet.py,sha256=JQxoiJIuCbSI6NkwVJEbH3MBCksBk8qsH90rnWrYRog,273151
12
+ tksheet/sheet.py,sha256=l2wmgl2gHmL1G2RDPm-qRlwGShRHLQQMHzbdeoTzkfk,273171
13
13
  tksheet/sheet_options.py,sha256=Lse8YQK9GvCoqaEcRWAVqZrg9FyW-2CKgLwo7t9ee_I,14739
14
14
  tksheet/sorting.py,sha256=zcZPpRtP1h_xJGtGkG3E43H7deKQFnh9cMwZ1B2-aGc,17502
15
15
  tksheet/text_editor.py,sha256=Ksz4kT7TrCIzDhRZK9EM54M7R_5CvrwC1aeTrUPNOTg,8391
@@ -17,8 +17,8 @@ tksheet/themes.py,sha256=kUUCUmvgu8vUlzfVNk9a3BEbeBcU3asNwPB_u-OejCY,18471
17
17
  tksheet/tksheet_types.py,sha256=qthH565jq60QCAeczvIWttIa4X5rFfLWPSwWBMDPilw,4611
18
18
  tksheet/tooltip.py,sha256=Ns7MhhSzx0-5v18TDE7kl5jvOnZ6v57Qh5DOs_Lvc5s,12398
19
19
  tksheet/top_left_rectangle.py,sha256=A4wWL8PFl57Pn2Ek71rASCE1-bW844cTl7bgt4tLWzI,8499
20
- tksheet-7.5.11.dist-info/licenses/LICENSE.txt,sha256=n1UvJHBr-AYNOf6ExICDsEggh9R7U4V4m_gH7FD-y-o,2305
21
- tksheet-7.5.11.dist-info/METADATA,sha256=iViDS-kYC_tktBm-fTd_hW274EsMulls5ruBzP0daZg,9475
22
- tksheet-7.5.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- tksheet-7.5.11.dist-info/top_level.txt,sha256=my61PXCcck_HHAc9cq3NAlyAr3A3FXxCy9gptEOaCN8,8
24
- tksheet-7.5.11.dist-info/RECORD,,
20
+ tksheet-7.5.12.dist-info/licenses/LICENSE.txt,sha256=n1UvJHBr-AYNOf6ExICDsEggh9R7U4V4m_gH7FD-y-o,2305
21
+ tksheet-7.5.12.dist-info/METADATA,sha256=Ea9FCFWptle102ucKjdC8dIV2s2Ze-tQ-Lxaz-AAS5Y,9465
22
+ tksheet-7.5.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ tksheet-7.5.12.dist-info/top_level.txt,sha256=my61PXCcck_HHAc9cq3NAlyAr3A3FXxCy9gptEOaCN8,8
24
+ tksheet-7.5.12.dist-info/RECORD,,