cgse-common 2024.1.4__py3-none-any.whl → 2024.1.5__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.
- {cgse_common-2024.1.4.dist-info → cgse_common-2024.1.5.dist-info}/METADATA +1 -1
- {cgse_common-2024.1.4.dist-info → cgse_common-2024.1.5.dist-info}/RECORD +5 -5
- egse/env.py +34 -8
- {cgse_common-2024.1.4.dist-info → cgse_common-2024.1.5.dist-info}/WHEEL +0 -0
- {cgse_common-2024.1.4.dist-info → cgse_common-2024.1.5.dist-info}/entry_points.txt +0 -0
|
@@ -5,7 +5,7 @@ egse/config.py,sha256=Ib1Ddt0wFwRrioBvMs7Md-wgEEPdK3eaXCt0H7HJEow,14888
|
|
|
5
5
|
egse/control.py,sha256=gM9II-BgtgJjG7NqxyY8nBtMiRD0b9azGYFeD9_WU6s,12816
|
|
6
6
|
egse/decorators.py,sha256=M0PavrPcTwhWS6yLlEo-mOS20lcy90Mym7HUVzPNmhs,13404
|
|
7
7
|
egse/device.py,sha256=SIMROwB9YdNdFowTcZp1HW_el8LWVWDJ5tDUxs58YuY,8500
|
|
8
|
-
egse/env.py,sha256=
|
|
8
|
+
egse/env.py,sha256=rNuqyQh2fRNIYC9tIwubnKVr7ctzUyQYqouJoyZKzmk,21968
|
|
9
9
|
egse/exceptions.py,sha256=Tc1xqUrWxV6SXxc9xB9viK_O-GVa_SpzqZUVEhZkwzA,1801
|
|
10
10
|
egse/hk.py,sha256=MOX9KgkBkEpAtWniHXc8IWHyravp3OqTV4ZIuzmr93s,31141
|
|
11
11
|
egse/metrics.py,sha256=cZKMEe3OTT2uomj7vXjEl54JD0CStfEC4nCgS6U5YSM,3794
|
|
@@ -30,7 +30,7 @@ egse/state.py,sha256=ekcCZu_DZKkKYn-5iWG7ij7Aif2WYMNVs5h3cia-cVc,5352
|
|
|
30
30
|
egse/system.py,sha256=t2NrtTAPXbMgBxsqicGjti-b8oEmiHtQu2Ydm77q4lI,48941
|
|
31
31
|
egse/version.py,sha256=EigdH05E8pNtSQznUfqM_RxlOjuAVp3Oe6S6MM5xGIM,6132
|
|
32
32
|
egse/zmq_ser.py,sha256=2-nwVUBWZ3vvosKNmlWobHJrIJA2HlM3V5a63Gz2JY0,1819
|
|
33
|
-
cgse_common-2024.1.
|
|
34
|
-
cgse_common-2024.1.
|
|
35
|
-
cgse_common-2024.1.
|
|
36
|
-
cgse_common-2024.1.
|
|
33
|
+
cgse_common-2024.1.5.dist-info/METADATA,sha256=SJEF1KdZFEZz_Rg7Dj_WdMQknWLArJaBMKrKA6FBlcA,2574
|
|
34
|
+
cgse_common-2024.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
35
|
+
cgse_common-2024.1.5.dist-info/entry_points.txt,sha256=E-KaQ9NGWAP1XvLHncNxq5oa22EAf9sOpBZWphXcxiE,34
|
|
36
|
+
cgse_common-2024.1.5.dist-info/RECORD,,
|
egse/env.py
CHANGED
|
@@ -448,6 +448,12 @@ def main(args: list | None = None): # pragma: no cover
|
|
|
448
448
|
action="store_true",
|
|
449
449
|
help="Print help on the environment variables and paths.",
|
|
450
450
|
)
|
|
451
|
+
parser.add_argument(
|
|
452
|
+
"--mkdir",
|
|
453
|
+
default=False,
|
|
454
|
+
action="store_true",
|
|
455
|
+
help="Create directory that doesn't exist.",
|
|
456
|
+
)
|
|
451
457
|
|
|
452
458
|
args = parser.parse_args(args or [])
|
|
453
459
|
|
|
@@ -497,34 +503,54 @@ def main(args: list | None = None): # pragma: no cover
|
|
|
497
503
|
with all_logging_disabled():
|
|
498
504
|
warnings.filterwarnings("ignore", category=UserWarning)
|
|
499
505
|
try:
|
|
500
|
-
rich.print(f" {get_data_storage_location() = }", flush=True)
|
|
506
|
+
rich.print(f" {get_data_storage_location() = }", flush=True, end="")
|
|
501
507
|
location = get_data_storage_location()
|
|
502
508
|
if not Path(location).exists():
|
|
503
|
-
|
|
509
|
+
if args.mkdir:
|
|
510
|
+
rich.print(f" [green]⟶ Creating data storage location: {location}[/]")
|
|
511
|
+
Path(location).mkdir(parents=True)
|
|
512
|
+
else:
|
|
513
|
+
rich.print(" [red]⟶ ERROR: The data storage location doesn't exist![/]")
|
|
514
|
+
else:
|
|
515
|
+
rich.print()
|
|
504
516
|
except ValueError as exc:
|
|
505
517
|
rich.print(f" get_data_storage_location() = [red]{exc}[/]")
|
|
506
518
|
|
|
507
519
|
try:
|
|
508
|
-
rich.print(f" {get_conf_data_location() = }", flush=True)
|
|
520
|
+
rich.print(f" {get_conf_data_location() = }", flush=True, end="")
|
|
509
521
|
location = get_conf_data_location()
|
|
510
522
|
if not Path(location).exists():
|
|
511
|
-
|
|
523
|
+
if args.mkdir:
|
|
524
|
+
rich.print(f" [green]⟶ Creating configuration data location: {location}[/]")
|
|
525
|
+
Path(location).mkdir(parents=True)
|
|
526
|
+
else:
|
|
527
|
+
rich.print(" [red]⟶ ERROR: The configuration data location doesn't exist![/]")
|
|
528
|
+
else:
|
|
529
|
+
rich.print()
|
|
512
530
|
except ValueError as exc:
|
|
513
531
|
rich.print(f" get_conf_data_location() = [red]{exc}[/]")
|
|
514
532
|
|
|
515
533
|
try:
|
|
516
|
-
rich.print(f" {get_log_file_location() = }", flush=True)
|
|
534
|
+
rich.print(f" {get_log_file_location() = }", flush=True, end="")
|
|
517
535
|
location = get_log_file_location()
|
|
518
536
|
if not Path(location).exists():
|
|
519
|
-
|
|
537
|
+
if args.mkdir:
|
|
538
|
+
rich.print(f" [green]⟶ Creating log files location: {location}[/]")
|
|
539
|
+
Path(location).mkdir(parents=True)
|
|
540
|
+
else:
|
|
541
|
+
rich.print(" [red]⟶ ERROR: The log files location doesn't exist![/]")
|
|
542
|
+
else:
|
|
543
|
+
rich.print()
|
|
520
544
|
except ValueError as exc:
|
|
521
545
|
rich.print(f" get_log_file_location() = [red]{exc}[/]")
|
|
522
546
|
|
|
523
547
|
try:
|
|
524
|
-
rich.print(f" {get_local_settings() = }", flush=True)
|
|
548
|
+
rich.print(f" {get_local_settings() = }", flush=True, end="")
|
|
525
549
|
location = get_local_settings()
|
|
526
550
|
if location is None or not Path(location).exists():
|
|
527
|
-
rich.print("[red]ERROR: The local settings file doesn't exist![/]")
|
|
551
|
+
rich.print(" [red]⟶ ERROR: The local settings file is not defined or doesn't exist![/]")
|
|
552
|
+
else:
|
|
553
|
+
rich.print()
|
|
528
554
|
except ValueError as exc:
|
|
529
555
|
rich.print(f" get_local_settings() = [red]{exc}[/]")
|
|
530
556
|
|
|
File without changes
|
|
File without changes
|