bluer-options 5.175.1__tar.gz → 5.181.1__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.

Potentially problematic release.


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

Files changed (82) hide show
  1. {bluer_options-5.175.1/bluer_options.egg-info → bluer_options-5.181.1}/PKG-INFO +1 -1
  2. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/__init__.py +1 -1
  3. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/host/functions.py +6 -1
  4. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/logger/config.py +9 -5
  5. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/timing/classes.py +12 -4
  6. {bluer_options-5.175.1 → bluer_options-5.181.1/bluer_options.egg-info}/PKG-INFO +1 -1
  7. {bluer_options-5.175.1 → bluer_options-5.181.1}/LICENSE +0 -0
  8. {bluer_options-5.175.1 → bluer_options-5.181.1}/MANIFEST.in +0 -0
  9. {bluer_options-5.175.1 → bluer_options-5.181.1}/README.md +0 -0
  10. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/alias.sh +0 -0
  11. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/assert.sh +0 -0
  12. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/bluer_options.sh +0 -0
  13. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/bool.sh +0 -0
  14. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/browse.sh +0 -0
  15. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/code.sh +0 -0
  16. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/backup.sh +0 -0
  17. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot/cat.sh +0 -0
  18. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot/cp.sh +0 -0
  19. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot/edit.sh +0 -0
  20. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot/load.sh +0 -0
  21. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot/seed.sh +0 -0
  22. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env/dot.sh +0 -0
  23. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/env.sh +0 -0
  24. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/eval.sh +0 -0
  25. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/generic_task.sh +0 -0
  26. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/help.sh +0 -0
  27. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/install.sh +0 -0
  28. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/list.sh +0 -0
  29. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/logging.sh +0 -0
  30. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/open.sh +0 -0
  31. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/options.sh +0 -0
  32. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/pause.sh +0 -0
  33. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/plugins.sh +0 -0
  34. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/pylint.sh +0 -0
  35. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/pytest.sh +0 -0
  36. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/repeat.sh +0 -0
  37. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/seed.sh +0 -0
  38. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/sleep.sh +0 -0
  39. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/source.sh +0 -0
  40. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/string.sh +0 -0
  41. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/terminal.sh +0 -0
  42. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/test.sh +0 -0
  43. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/wait.sh +0 -0
  44. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/.bash/watch.sh +0 -0
  45. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/__main__.py +0 -0
  46. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/assets/example1.sh +0 -0
  47. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/config.env +0 -0
  48. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/env/__init__.py +0 -0
  49. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/env/functions.py +0 -0
  50. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/help/__init__.py +0 -0
  51. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/help/__main__.py +0 -0
  52. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/help/functions.py +0 -0
  53. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/help/parsing.py +0 -0
  54. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/host/__init__.py +0 -0
  55. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/host/__main__.py +0 -0
  56. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/list/__init__.py +0 -0
  57. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/list/__main__.py +0 -0
  58. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/logger/__init__.py +0 -0
  59. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/logger/__main__.py +0 -0
  60. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/logger/watch.py +0 -0
  61. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/options/__init__.py +0 -0
  62. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/options/__main__.py +0 -0
  63. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/options/classes.py +0 -0
  64. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/string/__init__.py +0 -0
  65. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/string/__main__.py +0 -0
  66. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/string/constants.py +0 -0
  67. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/string/functions.py +0 -0
  68. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/terminal/__init__.py +0 -0
  69. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/terminal/__main__.py +0 -0
  70. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/terminal/functions.py +0 -0
  71. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/timer.py +0 -0
  72. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/timing/__init__.py +0 -0
  73. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/timing/elapsed_timer.py +0 -0
  74. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options/urls.py +0 -0
  75. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options.egg-info/SOURCES.txt +0 -0
  76. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options.egg-info/dependency_links.txt +0 -0
  77. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options.egg-info/requires.txt +0 -0
  78. {bluer_options-5.175.1 → bluer_options-5.181.1}/bluer_options.egg-info/top_level.txt +0 -0
  79. {bluer_options-5.175.1 → bluer_options-5.181.1}/pyproject.toml +0 -0
  80. {bluer_options-5.175.1 → bluer_options-5.181.1}/requirements.txt +0 -0
  81. {bluer_options-5.175.1 → bluer_options-5.181.1}/setup.cfg +0 -0
  82. {bluer_options-5.175.1 → bluer_options-5.181.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_options
3
- Version: 5.175.1
3
+ Version: 5.181.1
4
4
  Summary: 🌀 Options for Bash.
5
5
  Home-page: https://github.com/kamangir/bluer-options
6
6
  Author: Arash Abadpour (Kamangir)
@@ -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.181.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,
@@ -68,7 +75,7 @@ class Timing:
68
75
  ):
69
76
  log_list(
70
77
  logger,
71
- "took {} for".format(
78
+ "in {} called".format(
72
79
  self.elapsed_timer.as_str(
73
80
  stop=False,
74
81
  include_ms=include_ms,
@@ -81,7 +88,8 @@ class Timing:
81
88
  largest=largest,
82
89
  short=short,
83
90
  ),
84
- "function call(s):",
91
+ "function(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.181.1
4
4
  Summary: 🌀 Options for Bash.
5
5
  Home-page: https://github.com/kamangir/bluer-options
6
6
  Author: Arash Abadpour (Kamangir)
File without changes