bluer-options 5.181.1__tar.gz → 5.185.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.
- {bluer_options-5.181.1/bluer_options.egg-info → bluer_options-5.185.1}/PKG-INFO +1 -1
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/__init__.py +1 -1
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/string/__main__.py +35 -9
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/string/functions.py +4 -2
- {bluer_options-5.181.1 → bluer_options-5.185.1/bluer_options.egg-info}/PKG-INFO +1 -1
- {bluer_options-5.181.1 → bluer_options-5.185.1}/LICENSE +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/MANIFEST.in +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/README.md +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/alias.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/assert.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/bluer_options.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/bool.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/browse.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/code.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/backup.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot/cat.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot/cp.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot/edit.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot/load.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot/seed.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env/dot.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/env.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/eval.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/generic_task.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/help.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/install.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/list.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/logging.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/open.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/options.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/pause.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/plugins.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/pylint.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/pytest.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/repeat.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/seed.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/sleep.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/source.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/string.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/terminal.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/test.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/wait.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/.bash/watch.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/assets/example1.sh +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/config.env +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/env/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/env/functions.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/help/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/help/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/help/functions.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/help/parsing.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/host/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/host/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/host/functions.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/list/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/list/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/logger/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/logger/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/logger/config.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/logger/watch.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/options/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/options/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/options/classes.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/string/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/string/constants.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/terminal/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/terminal/__main__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/terminal/functions.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/timer.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/timing/__init__.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/timing/classes.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/timing/elapsed_timer.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options/urls.py +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options.egg-info/SOURCES.txt +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options.egg-info/dependency_links.txt +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options.egg-info/requires.txt +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/bluer_options.egg-info/top_level.txt +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/pyproject.toml +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/requirements.txt +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/setup.cfg +0 -0
- {bluer_options-5.181.1 → bluer_options-5.185.1}/setup.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import argparse
|
|
2
|
+
import random
|
|
2
3
|
|
|
3
4
|
from blueness import module
|
|
4
5
|
|
|
5
6
|
from bluer_options import NAME
|
|
6
|
-
from bluer_options
|
|
7
|
+
from bluer_options import string
|
|
7
8
|
|
|
8
9
|
NAME = module.name(__file__, NAME)
|
|
9
10
|
|
|
10
|
-
list_of_tasks = "after|before|pretty_date|random"
|
|
11
|
+
list_of_tasks = "after | before | pretty_date | random"
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
parser = argparse.ArgumentParser(NAME)
|
|
@@ -41,23 +42,48 @@ parser.add_argument(
|
|
|
41
42
|
help="0|1",
|
|
42
43
|
default=0,
|
|
43
44
|
)
|
|
45
|
+
parser.add_argument(
|
|
46
|
+
"--float",
|
|
47
|
+
type=int,
|
|
48
|
+
help="0|1",
|
|
49
|
+
default=0,
|
|
50
|
+
)
|
|
51
|
+
parser.add_argument(
|
|
52
|
+
"--min",
|
|
53
|
+
type=float,
|
|
54
|
+
default=0.0,
|
|
55
|
+
)
|
|
56
|
+
parser.add_argument(
|
|
57
|
+
"--max",
|
|
58
|
+
type=float,
|
|
59
|
+
default=100.0,
|
|
60
|
+
)
|
|
44
61
|
args = parser.parse_args()
|
|
45
62
|
|
|
46
|
-
success = args.task in list_of_tasks.split("|")
|
|
63
|
+
success = args.task in list_of_tasks.split(" | ")
|
|
47
64
|
if args.task == "after":
|
|
48
|
-
print(after(args.string, args.substring))
|
|
65
|
+
print(string.after(args.string, args.substring))
|
|
49
66
|
elif args.task == "before":
|
|
50
|
-
print(before(args.string, args.substring))
|
|
67
|
+
print(string.before(args.string, args.substring))
|
|
51
68
|
elif args.task == "pretty_date":
|
|
52
69
|
print(
|
|
53
|
-
pretty_date(
|
|
70
|
+
string.pretty_date(
|
|
54
71
|
as_filename=True,
|
|
55
|
-
include_time=args.include_time,
|
|
56
|
-
unique=args.unique,
|
|
72
|
+
include_time=args.include_time == 1,
|
|
73
|
+
unique=args.unique == 1,
|
|
57
74
|
)
|
|
58
75
|
)
|
|
59
76
|
elif args.task == "random":
|
|
60
|
-
print(
|
|
77
|
+
print(
|
|
78
|
+
"{:8}".format(
|
|
79
|
+
random.uniform(
|
|
80
|
+
args.min,
|
|
81
|
+
args.max,
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
if args.float == 1
|
|
85
|
+
else string.random(args.length)
|
|
86
|
+
)
|
|
61
87
|
else:
|
|
62
88
|
print(f"-{NAME}: {args.task}: command not found")
|
|
63
89
|
|
|
@@ -99,6 +99,7 @@ def pretty_date(
|
|
|
99
99
|
short: bool = False,
|
|
100
100
|
squeeze: bool = False,
|
|
101
101
|
unique: bool = False,
|
|
102
|
+
unique_length: int = 6,
|
|
102
103
|
) -> str:
|
|
103
104
|
format = ""
|
|
104
105
|
if include_date:
|
|
@@ -117,7 +118,7 @@ def pretty_date(
|
|
|
117
118
|
if include_seconds:
|
|
118
119
|
format += ":%S"
|
|
119
120
|
if unique:
|
|
120
|
-
format += f":{random(length=
|
|
121
|
+
format += f":{random(length=unique_length)}"
|
|
121
122
|
if as_filename:
|
|
122
123
|
format = (
|
|
123
124
|
format.replace(" ", "-")
|
|
@@ -304,11 +305,12 @@ def random(
|
|
|
304
305
|
return "".join(random_module.choice(alphabet) for _ in range(length))
|
|
305
306
|
|
|
306
307
|
|
|
307
|
-
def timestamp() -> str:
|
|
308
|
+
def timestamp(unique_length: int = 6) -> str:
|
|
308
309
|
return pretty_date(
|
|
309
310
|
as_filename=True,
|
|
310
311
|
include_time=True,
|
|
311
312
|
unique=True,
|
|
313
|
+
unique_length=unique_length,
|
|
312
314
|
)
|
|
313
315
|
|
|
314
316
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|