tksheet 7.3.4__py3-none-any.whl → 7.4.1__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/other_classes.py CHANGED
@@ -3,7 +3,7 @@ from __future__ import annotations
3
3
  import pickle
4
4
  import tkinter as tk
5
5
  from collections import namedtuple
6
- from collections.abc import Callable, Generator, Hashable, Iterator
6
+ from collections.abc import Callable, Hashable, Iterator
7
7
  from functools import partial
8
8
  from typing import Literal
9
9
 
@@ -404,7 +404,7 @@ class Span(dict):
404
404
  return "cell"
405
405
 
406
406
  @property
407
- def rows(self) -> Generator[int]:
407
+ def rows(self) -> SpanRange:
408
408
  rng_from_r = 0 if self["from_r"] is None else self["from_r"]
409
409
  if self["upto_r"] is None:
410
410
  rng_upto_r = self["widget"].total_rows()
@@ -413,7 +413,7 @@ class Span(dict):
413
413
  return SpanRange(rng_from_r, rng_upto_r)
414
414
 
415
415
  @property
416
- def columns(self) -> Generator[int]:
416
+ def columns(self) -> SpanRange:
417
417
  rng_from_c = 0 if self["from_c"] is None else self["from_c"]
418
418
  if self["upto_c"] is None:
419
419
  rng_upto_c = self["widget"].total_columns()
@@ -421,6 +421,12 @@ class Span(dict):
421
421
  rng_upto_c = self["upto_c"]
422
422
  return SpanRange(rng_from_c, rng_upto_c)
423
423
 
424
+ @property
425
+ def coords(self) -> tuple[int, int, int, int]:
426
+ rows = self.rows
427
+ cols = self.columns
428
+ return Box_nt(rows.from_, cols.from_, rows.upto_, cols.upto_)
429
+
424
430
  def pickle_self(self) -> bytes:
425
431
  x = self["widget"]
426
432
  self["widget"] = None
@@ -446,15 +452,13 @@ class Node:
446
452
  self,
447
453
  text: str,
448
454
  iid: str,
449
- parent: Node | Literal[""] | None = None,
455
+ parent: str | None = None,
456
+ children: list[str] | None = None,
450
457
  ) -> None:
451
458
  self.text = text
452
459
  self.iid = iid
453
460
  self.parent = parent
454
- self.children = []
455
-
456
- def __str__(self) -> str:
457
- return self.text
461
+ self.children = children if children else []
458
462
 
459
463
 
460
464
  class StorageBase: