bluer-options 5.187.1__py3-none-any.whl → 5.194.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.187.1"
9
+ VERSION = "5.194.1"
10
10
 
11
11
  REPO_NAME = "bluer-options"
12
12
 
@@ -6,4 +6,5 @@ from bluer_options.logger.config import (
6
6
  log_list,
7
7
  log_list_as_str,
8
8
  log_long_text,
9
+ shorten_text,
9
10
  )
@@ -48,16 +48,31 @@ def crash_report(description):
48
48
  logger.error(f"crash: {description}", exc_info=1)
49
49
 
50
50
 
51
+ def shorten_text(
52
+ text: str,
53
+ max_length: int = 100,
54
+ ) -> str:
55
+ return (
56
+ "{}...".format(
57
+ text[: max_length - 3],
58
+ )
59
+ if len(text) > max_length
60
+ else text
61
+ )
62
+
63
+
51
64
  def log_long_text(
52
65
  logger: Logger,
53
66
  text: str,
54
67
  max_length: int = 100,
55
68
  ):
56
69
  logger.info(
57
- "{:,} char(s): {}{}".format(
70
+ "{:,} char(s): {}".format(
58
71
  len(text),
59
- text[:max_length],
60
- "..." if len(text) > max_length else "",
72
+ shorten_text(
73
+ text=text,
74
+ max_length=max_length,
75
+ ),
61
76
  )
62
77
  )
63
78
 
@@ -1,5 +1,6 @@
1
1
  import argparse
2
2
  import random
3
+ import os
3
4
 
4
5
  from blueness import module
5
6
 
@@ -80,6 +81,8 @@ elif args.task == "pretty_date":
80
81
  )
81
82
  )
82
83
  elif args.task == "random":
84
+ random.seed(os.getpid())
85
+
83
86
  print(
84
87
  ("{:0.8f}" if args.float == 1 else "{:0.0f}").format(
85
88
  random.uniform(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_options
3
- Version: 5.187.1
3
+ Version: 5.194.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=56tkD_4CoZxBlwzs2SA7-pByFN1PSwBao91XBJDFByg,288
1
+ bluer_options/__init__.py,sha256=P1NzRoBlRwiVTWMBmdj3zlb7rKUmxw4T-7wjNBINZF0,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
@@ -50,15 +50,15 @@ bluer_options/host/__main__.py,sha256=A0Z-sAG9lVpQx9ULzroAINPw2sZyzouUvwrYU_8QtS
50
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
- bluer_options/logger/__init__.py,sha256=2k9853tBtpTx00sBQwI_YTyacYpN6WK6obK4IWMvz7s,158
53
+ bluer_options/logger/__init__.py,sha256=UdUJHEQxgBC0Kn4TCEX_Nrwbec_gE82-ZTc_PugBXGk,176
54
54
  bluer_options/logger/__main__.py,sha256=YetPs-lCkHDrmMgFB7pVs9icIqT5aFVA2nU0bgFN7_w,625
55
- bluer_options/logger/config.py,sha256=g42lHFbMKM91-vH_ndSIP8AqsW4yifNK04nRy8C1LSE,3651
55
+ bluer_options/logger/config.py,sha256=HOkygUtlXoBY_SFQ_FMWpPHuvptaP00wMbGg6CzN25c,3885
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
59
59
  bluer_options/options/classes.py,sha256=dcfGd34y6vDYvj-v-Bb5uOyy79mwV0s98czYFJ9hB9U,2211
60
60
  bluer_options/string/__init__.py,sha256=MsbbLbg13Pmq2qkYqwOU1bc27_VvfiZ_alcKYH7zzI8,546
61
- bluer_options/string/__main__.py,sha256=yv6pNK4cYua6ySYbxpACfIiF4NSNAoBiiaMWQmWt_wU,1844
61
+ bluer_options/string/__main__.py,sha256=uwTvAy6VEKqrtV61G8TuG3iNt2J3CnCYtx8COZb3SKA,1884
62
62
  bluer_options/string/constants.py,sha256=hfUx6xihcOsTayceAumyxyV2fbAr45_o4J-4ejKWrgM,216
63
63
  bluer_options/string/functions.py,sha256=Z8_9F-4_KescGQgNBsRVHU7S1UtYrlV_kMJPwcvha3A,8038
64
64
  bluer_options/terminal/__init__.py,sha256=kyNhbC5NVCuqrUhbbTeAOTW1ZO7MRRbi0RtXGBFKtJc,73
@@ -67,8 +67,8 @@ bluer_options/terminal/functions.py,sha256=A23uHLeU4JIctmecOFk_KhIfOeHu-WMjnSzBj
67
67
  bluer_options/timing/__init__.py,sha256=CCIJKvRVdimLdk46WOc_C-t8HHTVFPdGxQTFCFrN5zc,127
68
68
  bluer_options/timing/classes.py,sha256=6savdv6s_2IJaGvTzHK_umeu51Qoj4JCJc_Ey4WEAyY,3795
69
69
  bluer_options/timing/elapsed_timer.py,sha256=ecM11nzXnoDL_k6p41YPH28-OLnYreg_CgPQlbv4mjI,897
70
- bluer_options-5.187.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
71
- bluer_options-5.187.1.dist-info/METADATA,sha256=BH41KlDi9gqOZyia3V-9qteKV44OFMZpu8cJjYPmFYA,4951
72
- bluer_options-5.187.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
- bluer_options-5.187.1.dist-info/top_level.txt,sha256=yw9slt8n3R7IiYmf83OtHtB8Z-EgP9UwyQTk1EGiAJU,14
74
- bluer_options-5.187.1.dist-info/RECORD,,
70
+ bluer_options-5.194.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
71
+ bluer_options-5.194.1.dist-info/METADATA,sha256=yG8oyUyzIO8yA9Hxe-SmW8TDYDoHBOxOqrRkF1R3T3k,4951
72
+ bluer_options-5.194.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
73
+ bluer_options-5.194.1.dist-info/top_level.txt,sha256=yw9slt8n3R7IiYmf83OtHtB8Z-EgP9UwyQTk1EGiAJU,14
74
+ bluer_options-5.194.1.dist-info/RECORD,,