reykit 1.1.35__py3-none-any.whl → 1.1.37__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.
reykit/ros.py CHANGED
@@ -42,14 +42,6 @@ from json import JSONDecodeError
42
42
  from tomllib import loads as tomllib_loads
43
43
  from hashlib import md5 as hashlib_md5
44
44
  from tempfile import TemporaryFile, TemporaryDirectory
45
- from docx import Document as docx_document
46
- from docx.document import Document
47
- from docx.text.paragraph import Paragraph
48
- from docx.table import Table
49
- from docx.oxml.text.paragraph import CT_P
50
- from docx.oxml.table import CT_Tbl
51
- from lxml.etree import ElementChildIterator
52
- from pdfplumber import open as pdfplumber_open
53
45
 
54
46
  from .rbase import Base, throw
55
47
  from .rdata import to_json
@@ -1900,6 +1892,15 @@ def extract_docx_content(path: str) -> str:
1900
1892
  Content.
1901
1893
  """
1902
1894
 
1895
+ # Import.
1896
+ from docx import Document as docx_document
1897
+ from docx.document import Document
1898
+ from docx.text.paragraph import Paragraph
1899
+ from docx.table import Table
1900
+ from docx.oxml.text.paragraph import CT_P
1901
+ from docx.oxml.table import CT_Tbl
1902
+ from lxml.etree import ElementChildIterator
1903
+
1903
1904
  # Extract.
1904
1905
  document: Document = docx_document(path)
1905
1906
  childs_iter: ElementChildIterator = document.element.body.iterchildren()
@@ -1952,6 +1953,9 @@ def extract_pdf_content(path: str) -> str:
1952
1953
  Content.
1953
1954
  """
1954
1955
 
1956
+ # Import.
1957
+ from pdfplumber import open as pdfplumber_open
1958
+
1955
1959
  # Extract.
1956
1960
  document = pdfplumber_open(path)
1957
1961
  contents = [
reykit/rtime.py CHANGED
@@ -480,7 +480,7 @@ def wait(
480
480
 
481
481
  ## Timeout.
482
482
  rtm()
483
- if rtm.total_spend > _timeout:
483
+ if rtm.__total_spend > _timeout:
484
484
 
485
485
  ### Throw exception.
486
486
  if _raising:
@@ -493,12 +493,20 @@ def wait(
493
493
 
494
494
  ## Return.
495
495
  rtm()
496
- return rtm.total_spend
496
+ return rtm.__total_spend
497
497
 
498
498
 
499
499
  class TimeMark(Base):
500
500
  """
501
501
  Time mark type.
502
+
503
+ Examples
504
+ --------
505
+ >>> timemark = TimeMark()
506
+ >>> timemark('one')
507
+ >>> timemark['two']
508
+ >>> timemark.three
509
+ >>> print(timemark)
502
510
  """
503
511
 
504
512
 
@@ -511,7 +519,7 @@ class TimeMark(Base):
511
519
  self.record: dict[int, RecordData] = {}
512
520
 
513
521
 
514
- def mark(self, note: str | None = None) -> int:
522
+ def __mark(self, note: str | None = None) -> int:
515
523
  """
516
524
  Marking now time.
517
525
 
@@ -549,9 +557,9 @@ class TimeMark(Base):
549
557
  return index
550
558
 
551
559
 
552
- def report(self, title: str | None = None):
560
+ def __get_report(self, title: str | None = None):
553
561
  """
554
- Print and return time mark information table.
562
+ Return time mark report table.
555
563
 
556
564
  Parameters
557
565
  ----------
@@ -561,7 +569,7 @@ class TimeMark(Base):
561
569
 
562
570
  Returns
563
571
  -------
564
- Time mark information table
572
+ Time mark report table.
565
573
  """
566
574
 
567
575
  # Import.
@@ -618,15 +626,11 @@ class TimeMark(Base):
618
626
  df_info = DataFrame(data, index=indexes)
619
627
  df_info.fillna('-', inplace=True)
620
628
 
621
- # Print.
622
- if title is not None:
623
- echo(df_info, title=title)
624
-
625
629
  return df_info
626
630
 
627
631
 
628
632
  @property
629
- def total_spend(self) -> float:
633
+ def __total_spend(self) -> float:
630
634
  """
631
635
  Get total spend seconds.
632
636
 
@@ -660,7 +664,7 @@ class TimeMark(Base):
660
664
  """
661
665
 
662
666
  # Get.
663
- report = self.report()
667
+ report = self.__get_report()
664
668
 
665
669
  # Convert.
666
670
  string = str(report)
@@ -668,4 +672,6 @@ class TimeMark(Base):
668
672
  return string
669
673
 
670
674
 
671
- __call__ = mark
675
+ __call__ = __getitem__ = __getattr__ = __mark
676
+
677
+ __float__ = __total_spend
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.35
3
+ Version: 1.1.37
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -29,7 +29,6 @@ Requires-Dist: pyzbar
29
29
  Requires-Dist: qrcode
30
30
  Requires-Dist: requests
31
31
  Requires-Dist: requests-cache
32
- Requires-Dist: tqdm
33
32
  Requires-Dist: varname
34
33
  Description-Content-Type: text/markdown
35
34
 
@@ -8,7 +8,7 @@ reykit/rlog.py,sha256=ykZ8tmMJtwEaAgXmtgtU3SghJG8-ArCIiw0ZawXastg,25564
8
8
  reykit/rmonkey.py,sha256=f5vA4t9R6Nz2xfTRUSo2NJ140eg9kT12eaNkKat2AGo,8140
9
9
  reykit/rnet.py,sha256=uS27Ownt9ELsjVKpGMPVN1Endc9s7z7CfIBkfE8bPMs,15033
10
10
  reykit/rnum.py,sha256=PhG4V_BkVfCJUsbpMDN1umGZly1Hsus80TW8bpyBtyY,3653
11
- reykit/ros.py,sha256=7Lvh_-eERtJ25tIb-37oAK6MqlpoO2iv5oyfsHbb7sg,40865
11
+ reykit/ros.py,sha256=E-80r7NyLoi2VUyHTIE8Euz7JxFAwhwrdTeG00Zb-q0,40931
12
12
  reykit/rrand.py,sha256=9QPXCsREIu45g6WP-XN67X05kmW3cTmctn3InvqYxuY,8947
13
13
  reykit/rre.py,sha256=4DVxy28dl5zn6_II8-cgr7E2nVPH5QJIJVB4o7Vsf1A,6078
14
14
  reykit/rschedule.py,sha256=_nrfrXYxlFAKCDbM8ibTTb60zNDlHxyE310cv-A19Kw,5799
@@ -17,12 +17,12 @@ reykit/rsys.py,sha256=8Q9ZdggxRHXHMOwjMQa_kBN3gTkmpduHoXrKfa5UXqs,24933
17
17
  reykit/rtable.py,sha256=32Dcs2OYI88GGiF6QMGMyPeeL5mhoa-QlygVXkRklkE,12536
18
18
  reykit/rtask.py,sha256=Jl2s3cc5i_oKsGu0XJwhzwVwL6LNCULPthlS9N17aeg,22846
19
19
  reykit/rtext.py,sha256=sFp5n5ykD6B812Bywhe6gqzscNmx-U6w80Zf8p1y-Ow,12859
20
- reykit/rtime.py,sha256=JdZ1MC0a5nc321yYoG1NX2H7U1XAcqXrTtNAu5U9-6k,16875
20
+ reykit/rtime.py,sha256=PfhsXZLmSsKY2W1A0VrjhaVbMKVBHBD86AZ8nowNGig,17008
21
21
  reykit/rwrap.py,sha256=RK3wlc2cd-lnAvzqzvKsS21EtCmBNTA3i8HRbaolWE4,15275
22
22
  reykit/rzip.py,sha256=ABUDLwEHQIpcvZbJE_oV78H7dik6nC7kaRz660Ro9Os,3481
23
23
  reykit/rdll/__init__.py,sha256=1VRawI2vCsLH7KK0PcBRWNc-bwseM-M05wkc_eamwJM,696
24
24
  reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.35.dist-info/METADATA,sha256=26K4EtOs7mQTxTcRTpKWhTU5uFhtiuW5GQ8PZ-QZY0U,1892
26
- reykit-1.1.35.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.35.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.35.dist-info/RECORD,,
25
+ reykit-1.1.37.dist-info/METADATA,sha256=HTGuMy6_L6C6sxlCnglmakS0ln7LZ5mWFNAEo0TbS7I,1872
26
+ reykit-1.1.37.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.37.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.37.dist-info/RECORD,,