bluer-options 5.175.1__py3-none-any.whl → 5.180.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.

Potentially problematic release.


This version of bluer-options might be problematic. Click here for more details.

bluer_options/__init__.py CHANGED
@@ -6,7 +6,7 @@ ICON = "🌀"
6
6
 
7
7
  DESCRIPTION = f"{ICON} Options for Bash."
8
8
 
9
- VERSION = "5.175.1"
9
+ VERSION = "5.180.1"
10
10
 
11
11
  REPO_NAME = "bluer-options"
12
12
 
@@ -2,6 +2,8 @@ from typing import List
2
2
  import os
3
3
 
4
4
  from blueness import module
5
+ from blueness import NAME as blueness_NAME
6
+ from blueness import VERSION as blueness_VERSION
5
7
  from bluer_options import NAME, env, fullname, string
6
8
  from bluer_options.logger import crash_report
7
9
 
@@ -128,7 +130,10 @@ def signature() -> List[str]:
128
130
  import platform
129
131
 
130
132
  return (
131
- [fullname()]
133
+ [
134
+ fullname(),
135
+ f"{blueness_NAME}-{blueness_VERSION}",
136
+ ]
132
137
  + tensor_processing_signature()
133
138
  + [
134
139
  "Python {}".format(platform.python_version()),
@@ -98,8 +98,12 @@ def log_list_as_str(
98
98
  len(list_of_items),
99
99
  item_name_plural,
100
100
  ", ".join(
101
- list_of_items[:max_count]
102
- + (["..."] if len(list_of_items) > max_count else [])
101
+ list_of_items
102
+ if max_count == -1
103
+ else (
104
+ list_of_items[:max_count]
105
+ + (["..."] if len(list_of_items) > max_count else [])
106
+ )
103
107
  ),
104
108
  )
105
109
 
@@ -130,11 +134,11 @@ def log_list(
130
134
  logger.info(
131
135
  "#{: 4} - {}{}".format(
132
136
  index,
133
- item[:max_length],
134
- "..." if len(item) > max_length else "",
137
+ item if max_length == -1 else item[:max_length],
138
+ "" if max_length == -1 else "..." if len(item) > max_length else "",
135
139
  )
136
140
  )
137
141
 
138
- if index >= max_count - 1:
142
+ if max_count != -1 and index >= max_count - 1:
139
143
  logger.info("...")
140
144
  break
@@ -38,9 +38,13 @@ class Timing:
38
38
 
39
39
  @property
40
40
  def as_dict(self) -> Dict:
41
+ self.calculate()
42
+
41
43
  return recursive_to_dict(self.stats)
42
44
 
43
45
  def as_list(self, **kwgrs) -> List[str]:
46
+ self.calculate()
47
+
44
48
  lines = []
45
49
  # sort items by total time (descending)
46
50
  for k, v in sorted(
@@ -48,17 +52,20 @@ class Timing:
48
52
  key=lambda item: item[1]["total"],
49
53
  reverse=True,
50
54
  ):
51
- avg = v["total"] / v["count"]
52
55
  lines.append(
53
56
  "{}: called {:,} time(s), total {}, avg {}".format(
54
57
  k,
55
58
  v["count"],
56
59
  string.pretty_duration(v["total"], **kwgrs),
57
- string.pretty_duration(avg, **kwgrs),
60
+ string.pretty_duration(v["average"], **kwgrs),
58
61
  )
59
62
  )
60
63
  return lines
61
64
 
65
+ def calculate(self):
66
+ for v in self.stats.values():
67
+ v["average"] = v["total"] / v["count"]
68
+
62
69
  def log(
63
70
  self,
64
71
  include_ms: bool = True,
@@ -82,6 +89,7 @@ class Timing:
82
89
  short=short,
83
90
  ),
84
91
  "function call(s):",
92
+ max_count=-1,
85
93
  **kwargs,
86
94
  )
87
95
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_options
3
- Version: 5.175.1
3
+ Version: 5.180.1
4
4
  Summary: 🌀 Options for Bash.
5
5
  Home-page: https://github.com/kamangir/bluer-options
6
6
  Author: Arash Abadpour (Kamangir)
@@ -1,4 +1,4 @@
1
- bluer_options/__init__.py,sha256=aDCJFUDVdq3MwloKECDq-_nrNs8t5Ew3DjcawqN13c4,288
1
+ bluer_options/__init__.py,sha256=px6G3h1DV44jAkL5XhcsG6myUouEJGoNWKZq-idmElU,288
2
2
  bluer_options/__main__.py,sha256=-6ce9W1uXkle4YtEYlSUMWxSmsur3dRDA4_MvNNhEVg,236
3
3
  bluer_options/config.env,sha256=2AG3xuWiMqaNmlCNDWQOJ_AssKk7KXhn0XDIkHWNQ2Q,30
4
4
  bluer_options/timer.py,sha256=UPmsfCjbEWpcjXgMpYemXieheMJH_UpuemhVGsKYVoE,2470
@@ -47,12 +47,12 @@ bluer_options/help/functions.py,sha256=NHvjbO9jbouXsynP7MR2p8xxbF4J1Qwf3HCt3YZWR
47
47
  bluer_options/help/parsing.py,sha256=jpeC3NO0W4wEK7KoiHNyq7TRK7OiVsO0IQCvkoqI3tw,1030
48
48
  bluer_options/host/__init__.py,sha256=Cy_zamSTzv7F2sktvO6_gdK21eeps4FI7EIaltXU7UU,335
49
49
  bluer_options/host/__main__.py,sha256=A0Z-sAG9lVpQx9ULzroAINPw2sZyzouUvwrYU_8QtSs,775
50
- bluer_options/host/functions.py,sha256=SZnEaPp1dvQuWi8K_skwI3wQXr7PKtwUBI1qJ2RqoIM,4036
50
+ bluer_options/host/functions.py,sha256=enPoxWBzKujMXnyg7kP-SFM2bbZI6vh12AonX6TnydU,4202
51
51
  bluer_options/list/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  bluer_options/list/__main__.py,sha256=er69iqdooU9Hb-7Vl6CAUMgQmZApSq_BTDnLT4xCjWI,3646
53
53
  bluer_options/logger/__init__.py,sha256=2k9853tBtpTx00sBQwI_YTyacYpN6WK6obK4IWMvz7s,158
54
54
  bluer_options/logger/__main__.py,sha256=YetPs-lCkHDrmMgFB7pVs9icIqT5aFVA2nU0bgFN7_w,625
55
- bluer_options/logger/config.py,sha256=fBsZb1sTLf_iVR_Cq7Xpiyka4cp0OV-Ps2GFrdz_g9U,3475
55
+ bluer_options/logger/config.py,sha256=g42lHFbMKM91-vH_ndSIP8AqsW4yifNK04nRy8C1LSE,3651
56
56
  bluer_options/logger/watch.py,sha256=4FJjbstlsAl3EF_2vx9Dshe4EmGrkR-VAQXZOmGV6jc,486
57
57
  bluer_options/options/__init__.py,sha256=q0Ymi9oCBwgN0g7NVeYh4XgiICOtH8W8Wuaa52NH-rw,50
58
58
  bluer_options/options/__main__.py,sha256=wnCzX2dxIgrjZ6qoDnE_YBE6xzJO5ME5u-gCPmb02cw,1479
@@ -65,10 +65,10 @@ bluer_options/terminal/__init__.py,sha256=kyNhbC5NVCuqrUhbbTeAOTW1ZO7MRRbi0RtXGB
65
65
  bluer_options/terminal/__main__.py,sha256=3o465bp44c2f1KHDn4j664hpbvu8wKOwQ2c1OPoa6Xc,902
66
66
  bluer_options/terminal/functions.py,sha256=A23uHLeU4JIctmecOFk_KhIfOeHu-WMjnSzBj2KiF3U,1947
67
67
  bluer_options/timing/__init__.py,sha256=CCIJKvRVdimLdk46WOc_C-t8HHTVFPdGxQTFCFrN5zc,127
68
- bluer_options/timing/classes.py,sha256=28q4Yw6T-SOer8pNXx1eLhnSvkTWX9WaF6ZLjXAUzu8,3639
68
+ bluer_options/timing/classes.py,sha256=WAMY1UAau7_WIOF29BeiTXZJFfAzn7c1DcZ8I_8ZjUQ,3799
69
69
  bluer_options/timing/elapsed_timer.py,sha256=ecM11nzXnoDL_k6p41YPH28-OLnYreg_CgPQlbv4mjI,897
70
- bluer_options-5.175.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
71
- bluer_options-5.175.1.dist-info/METADATA,sha256=fvAGNzoVnxgTNAmp-L9IxiYQPKCyPOyegZwnwvtx1zc,4951
72
- bluer_options-5.175.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- bluer_options-5.175.1.dist-info/top_level.txt,sha256=yw9slt8n3R7IiYmf83OtHtB8Z-EgP9UwyQTk1EGiAJU,14
74
- bluer_options-5.175.1.dist-info/RECORD,,
70
+ bluer_options-5.180.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
71
+ bluer_options-5.180.1.dist-info/METADATA,sha256=1QFr-QYPtvhRkqQ8jbUTyZSJ5gPpuVByMWHdWpuOvqM,4951
72
+ bluer_options-5.180.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ bluer_options-5.180.1.dist-info/top_level.txt,sha256=yw9slt8n3R7IiYmf83OtHtB8Z-EgP9UwyQTk1EGiAJU,14
74
+ bluer_options-5.180.1.dist-info/RECORD,,