tksheet 7.5.2__tar.gz → 7.5.3__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 (26) hide show
  1. {tksheet-7.5.2/tksheet.egg-info → tksheet-7.5.3}/PKG-INFO +1 -1
  2. {tksheet-7.5.2 → tksheet-7.5.3}/pyproject.toml +1 -1
  3. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/__init__.py +1 -1
  4. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/column_headers.py +4 -10
  5. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/find_window.py +3 -3
  6. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/main_table.py +2 -1
  7. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/row_index.py +4 -10
  8. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/sheet.py +14 -46
  9. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/text_editor.py +3 -2
  10. {tksheet-7.5.2 → tksheet-7.5.3/tksheet.egg-info}/PKG-INFO +1 -1
  11. {tksheet-7.5.2 → tksheet-7.5.3}/LICENSE.txt +0 -0
  12. {tksheet-7.5.2 → tksheet-7.5.3}/README.md +0 -0
  13. {tksheet-7.5.2 → tksheet-7.5.3}/setup.cfg +0 -0
  14. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/colors.py +0 -0
  15. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/constants.py +0 -0
  16. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/formatters.py +0 -0
  17. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/functions.py +0 -0
  18. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/other_classes.py +0 -0
  19. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/sheet_options.py +0 -0
  20. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/sorting.py +0 -0
  21. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/themes.py +0 -0
  22. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/tksheet_types.py +0 -0
  23. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet/top_left_rectangle.py +0 -0
  24. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet.egg-info/SOURCES.txt +0 -0
  25. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet.egg-info/dependency_links.txt +0 -0
  26. {tksheet-7.5.2 → tksheet-7.5.3}/tksheet.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tksheet
3
- Version: 7.5.2
3
+ Version: 7.5.3
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
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
  name = "tksheet"
7
7
  description = "Tkinter table / sheet and treeview widget"
8
8
  readme = "README.md"
9
- version = "7.5.2"
9
+ version = "7.5.3"
10
10
  authors = [{ name = "ragardner", email = "github@ragardner.simplelogin.com" }]
11
11
  requires-python = ">=3.8"
12
12
  license = {file = "LICENSE.txt"}
@@ -4,7 +4,7 @@
4
4
  tksheet - A Python tkinter table widget
5
5
  """
6
6
 
7
- __version__ = "7.5.2"
7
+ __version__ = "7.5.3"
8
8
 
9
9
  from .colors import (
10
10
  color_map,
@@ -24,6 +24,7 @@ from .functions import (
24
24
  event_dict,
25
25
  event_has_char_key,
26
26
  event_opens_dropdown_or_checkbox,
27
+ get_menu_kwargs,
27
28
  get_n2a,
28
29
  int_x_tuple,
29
30
  is_contiguous,
@@ -35,7 +36,7 @@ from .functions import (
35
36
  try_binding,
36
37
  wrap_text,
37
38
  )
38
- from .other_classes import DotDict, DraggedRowColumn, DropdownStorage, EventDataDict, TextEditorStorage
39
+ from .other_classes import DraggedRowColumn, DropdownStorage, EventDataDict, TextEditorStorage
39
40
  from .row_index import RowIndex
40
41
  from .sorting import sort_column, sort_rows_by_column, sort_tree_rows_by_column
41
42
  from .text_editor import TextEditor
@@ -1804,16 +1805,9 @@ class ColumnHeaders(tk.Canvas):
1804
1805
  w = self.MT.col_positions[c + 1] - x
1805
1806
  h = self.current_height + 1
1806
1807
  kwargs = {
1807
- "menu_kwargs": DotDict(
1808
- {
1809
- "font": self.ops.table_font,
1810
- "foreground": self.ops.popup_menu_fg,
1811
- "background": self.ops.popup_menu_bg,
1812
- "activebackground": self.ops.popup_menu_highlight_bg,
1813
- "activeforeground": self.ops.popup_menu_highlight_fg,
1814
- }
1815
- ),
1808
+ "menu_kwargs": get_menu_kwargs(self.ops),
1816
1809
  "sheet_ops": self.ops,
1810
+ "font": self.ops.header_font,
1817
1811
  "border_color": self.ops.header_selected_columns_bg,
1818
1812
  "text": text,
1819
1813
  "state": state,
@@ -434,7 +434,7 @@ class FindWindow(tk.Frame):
434
434
  self.tktext.reset(
435
435
  menu_kwargs=menu_kwargs,
436
436
  sheet_ops=sheet_ops,
437
- font=menu_kwargs.font,
437
+ font=sheet_ops.table_font,
438
438
  bg=bg,
439
439
  fg=fg,
440
440
  select_bg=select_bg,
@@ -443,7 +443,7 @@ class FindWindow(tk.Frame):
443
443
  self.replace_tktext.reset(
444
444
  menu_kwargs=menu_kwargs,
445
445
  sheet_ops=sheet_ops,
446
- font=menu_kwargs.font,
446
+ font=sheet_ops.table_font,
447
447
  bg=bg,
448
448
  fg=fg,
449
449
  select_bg=select_bg,
@@ -459,7 +459,7 @@ class FindWindow(tk.Frame):
459
459
  self.replace_all,
460
460
  ):
461
461
  widget.config(
462
- font=menu_kwargs.font,
462
+ font=sheet_ops.table_font,
463
463
  bg=bg,
464
464
  fg=fg,
465
465
  highlightbackground=bg,
@@ -1222,7 +1222,7 @@ class MainTable(tk.Canvas):
1222
1222
  lastbox_numcols = lastbox_c2 - lastbox_c1
1223
1223
  if lastbox_numrows > new_data_numrows and not lastbox_numrows % new_data_numrows:
1224
1224
  repeat_num = int(lastbox_numrows / new_data_numrows)
1225
- data.extend(chain.from_iterable([r.copy() for r in data] for _ in range(repeat_num - 1)))
1225
+ data.extend(list(chain.from_iterable([r.copy() for r in data] for _ in range(repeat_num - 1))))
1226
1226
  new_data_numrows *= repeat_num
1227
1227
 
1228
1228
  if lastbox_numcols > new_data_numcols and not lastbox_numcols % new_data_numcols:
@@ -7587,6 +7587,7 @@ class MainTable(tk.Canvas):
7587
7587
  kwargs = {
7588
7588
  "menu_kwargs": get_menu_kwargs(self.PAR.ops),
7589
7589
  "sheet_ops": self.PAR.ops,
7590
+ "font": self.PAR.ops.table_font,
7590
7591
  "border_color": self.PAR.ops.table_selected_box_cells_fg,
7591
7592
  "text": text,
7592
7593
  "state": state,
@@ -26,6 +26,7 @@ from .functions import (
26
26
  event_dict,
27
27
  event_has_char_key,
28
28
  event_opens_dropdown_or_checkbox,
29
+ get_menu_kwargs,
29
30
  get_n2a,
30
31
  get_new_indexes,
31
32
  int_x_tuple,
@@ -39,7 +40,7 @@ from .functions import (
39
40
  try_binding,
40
41
  wrap_text,
41
42
  )
42
- from .other_classes import DotDict, DraggedRowColumn, DropdownStorage, EventDataDict, Node, TextEditorStorage
43
+ from .other_classes import DraggedRowColumn, DropdownStorage, EventDataDict, Node, TextEditorStorage
43
44
  from .sorting import sort_columns_by_row, sort_row
44
45
  from .text_editor import TextEditor
45
46
 
@@ -1976,16 +1977,9 @@ class RowIndex(tk.Canvas):
1976
1977
  w = self.current_width + 1
1977
1978
  h = self.MT.row_positions[r + 1] - y + 1
1978
1979
  kwargs = {
1979
- "menu_kwargs": DotDict(
1980
- {
1981
- "font": self.ops.index_font,
1982
- "foreground": self.ops.popup_menu_fg,
1983
- "background": self.ops.popup_menu_bg,
1984
- "activebackground": self.ops.popup_menu_highlight_bg,
1985
- "activeforeground": self.ops.popup_menu_highlight_fg,
1986
- }
1987
- ),
1980
+ "menu_kwargs": get_menu_kwargs(self.ops),
1988
1981
  "sheet_ops": self.ops,
1982
+ "font": self.ops.index_font,
1989
1983
  "border_color": self.ops.index_selected_rows_bg,
1990
1984
  "text": text,
1991
1985
  "state": state,
@@ -5500,17 +5500,8 @@ class Sheet(tk.Frame):
5500
5500
  readonly: bool = True,
5501
5501
  redraw: bool = False,
5502
5502
  ) -> Sheet:
5503
- if isinstance(rows, int):
5504
- rows = [rows]
5505
- if not readonly:
5506
- for r in rows:
5507
- if r in self.MT.row_options and "readonly" in self.MT.row_options[r]:
5508
- del self.MT.row_options[r]["readonly"]
5509
- else:
5510
- for r in rows:
5511
- if r not in self.MT.row_options:
5512
- self.MT.row_options[r] = {}
5513
- self.MT.row_options[r]["readonly"] = True
5503
+ for r in (rows,) if isinstance(rows, int) else rows:
5504
+ set_readonly(self.MT.row_options, r, readonly)
5514
5505
  return self.set_refresh_timer(redraw)
5515
5506
 
5516
5507
  def readonly_columns(
@@ -5519,17 +5510,8 @@ class Sheet(tk.Frame):
5519
5510
  readonly: bool = True,
5520
5511
  redraw: bool = False,
5521
5512
  ) -> Sheet:
5522
- if isinstance(columns, int):
5523
- columns = [columns]
5524
- if not readonly:
5525
- for c in columns:
5526
- if c in self.MT.col_options and "readonly" in self.MT.col_options[c]:
5527
- del self.MT.col_options[c]["readonly"]
5528
- else:
5529
- for c in columns:
5530
- if c not in self.MT.col_options:
5531
- self.MT.col_options[c] = {}
5532
- self.MT.col_options[c]["readonly"] = True
5513
+ for c in (columns,) if isinstance(columns, int) else columns:
5514
+ set_readonly(self.MT.col_options, c, readonly)
5533
5515
  return self.set_refresh_timer(redraw)
5534
5516
 
5535
5517
  def readonly_cells(
@@ -5540,45 +5522,31 @@ class Sheet(tk.Frame):
5540
5522
  readonly: bool = True,
5541
5523
  redraw: bool = False,
5542
5524
  ) -> Sheet:
5543
- if not readonly:
5544
- if cells:
5545
- for r, c in cells:
5546
- if (r, c) in self.MT.cell_options and "readonly" in self.MT.cell_options[(r, c)]:
5547
- del self.MT.cell_options[(r, c)]["readonly"]
5548
- else:
5549
- if (
5550
- row,
5551
- column,
5552
- ) in self.MT.cell_options and "readonly" in self.MT.cell_options[(row, column)]:
5553
- del self.MT.cell_options[(row, column)]["readonly"]
5525
+ if cells:
5526
+ for r, c in cells:
5527
+ set_readonly(self.MT.cell_options, (r, c), readonly=readonly)
5554
5528
  else:
5555
- if cells:
5556
- for r, c in cells:
5557
- if (r, c) not in self.MT.cell_options:
5558
- self.MT.cell_options[(r, c)] = {}
5559
- self.MT.cell_options[(r, c)]["readonly"] = True
5560
- else:
5561
- if (row, column) not in self.MT.cell_options:
5562
- self.MT.cell_options[(row, column)] = {}
5563
- self.MT.cell_options[(row, column)]["readonly"] = True
5529
+ set_readonly(self.MT.cell_options, (row, column), readonly=readonly)
5564
5530
  return self.set_refresh_timer(redraw)
5565
5531
 
5566
5532
  def readonly_header(
5567
5533
  self,
5568
- columns: list[int],
5534
+ columns: list[int] | int,
5569
5535
  readonly: bool = True,
5570
5536
  redraw: bool = False,
5571
5537
  ) -> Sheet:
5572
- self.CH.readonly_header(columns=columns, readonly=readonly)
5538
+ for c in (columns, int) if isinstance(columns, int) else columns:
5539
+ set_readonly(self.CH.cell_options, c, readonly)
5573
5540
  return self.set_refresh_timer(redraw)
5574
5541
 
5575
5542
  def readonly_index(
5576
5543
  self,
5577
- rows: list[int],
5544
+ rows: list[int] | int,
5578
5545
  readonly: bool = True,
5579
5546
  redraw: bool = False,
5580
5547
  ) -> Sheet:
5581
- self.RI.readonly_index(rows=rows, readonly=readonly)
5548
+ for r in (rows,) if isinstance(rows, int) else rows:
5549
+ set_readonly(self.RI.cell_options, r, readonly)
5582
5550
  return self.set_refresh_timer(redraw)
5583
5551
 
5584
5552
  def dehighlight_rows(
@@ -6,7 +6,7 @@ from typing import Any, Literal
6
6
 
7
7
  from .constants import align_helper, ctrl_key, rc_binding
8
8
  from .functions import convert_align
9
- from .other_classes import DotDict
9
+ from .other_classes import DotDict, FontTuple
10
10
 
11
11
 
12
12
  class TextEditorTkText(tk.Text):
@@ -231,6 +231,7 @@ class TextEditor(tk.Frame):
231
231
  show_border: bool,
232
232
  menu_kwargs: DotDict,
233
233
  sheet_ops: DotDict,
234
+ font: FontTuple,
234
235
  bg: str,
235
236
  fg: str,
236
237
  select_bg: str,
@@ -247,7 +248,7 @@ class TextEditor(tk.Frame):
247
248
  menu_kwargs=menu_kwargs,
248
249
  sheet_ops=sheet_ops,
249
250
  align=align,
250
- font=menu_kwargs.font,
251
+ font=font,
251
252
  bg=bg,
252
253
  fg=fg,
253
254
  select_bg=select_bg,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tksheet
3
- Version: 7.5.2
3
+ Version: 7.5.3
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
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