cgse-common 0.16.4__py3-none-any.whl → 0.16.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-0.16.4.dist-info → cgse_common-0.16.5.dist-info}/METADATA +1 -1
- {cgse_common-0.16.4.dist-info → cgse_common-0.16.5.dist-info}/RECORD +5 -5
- egse/env.py +9 -0
- {cgse_common-0.16.4.dist-info → cgse_common-0.16.5.dist-info}/WHEEL +0 -0
- {cgse_common-0.16.4.dist-info → cgse_common-0.16.5.dist-info}/entry_points.txt +0 -0
|
@@ -8,7 +8,7 @@ egse/counter.py,sha256=7UwBeTAu213xdNdGAOYpUWNQ4jD4yVM1bOG10Ax4UFs,5097
|
|
|
8
8
|
egse/decorators.py,sha256=B-zRa1WdLO71zqS5M27JBglcThYPho7seYfa4HOGj5c,27171
|
|
9
9
|
egse/device.py,sha256=nn2HkN1KIHAmo37WZcqig-p2mQz1LgqpIfj1wPrUTLc,13240
|
|
10
10
|
egse/dicts.py,sha256=dUAq7PTPvs73OrZb2Fh3loxvYv4ifUiK6bBcgrFU77Y,3972
|
|
11
|
-
egse/env.py,sha256=
|
|
11
|
+
egse/env.py,sha256=7HKzb61Mtd5f-kNoN6-Lrik1ZriWkplqE36CnBdRtAM,29074
|
|
12
12
|
egse/exceptions.py,sha256=QB3MZRJizecWOj1cPbvG0UcIqFn7NRJ6rw1xtdNSFxw,1225
|
|
13
13
|
egse/heartbeat.py,sha256=xt5mePu9Zr9fLAhN1MLq1Z7aCOKtNIhRVCAmWhtNwP8,3039
|
|
14
14
|
egse/hk.py,sha256=AumSpB8SYXes75CB2iiKXfLkMK5IkVDHITFKrf8IT6g,32010
|
|
@@ -39,7 +39,7 @@ egse/zmq_ser.py,sha256=d2lETLkLUll_F1Phc1pI7MEeA41uX7YZ8lhSFmBQZVw,3022
|
|
|
39
39
|
egse/plugins/metrics/duckdb.py,sha256=E2eeNo3I7ajRuByodaYiPNvC0Zwyc7hsIlhr1W_eXdo,16148
|
|
40
40
|
egse/plugins/metrics/influxdb.py,sha256=ecxjA_csYwf8RW3sXjiQxZHREfyrfStH1HA_rAs1AA8,6690
|
|
41
41
|
egse/plugins/metrics/timescaledb.py,sha256=Ug0NWDV1Ky2VeFY6tDZL9xg6AFgnAEh2F_llVPnlRBA,21191
|
|
42
|
-
cgse_common-0.16.
|
|
43
|
-
cgse_common-0.16.
|
|
44
|
-
cgse_common-0.16.
|
|
45
|
-
cgse_common-0.16.
|
|
42
|
+
cgse_common-0.16.5.dist-info/METADATA,sha256=sd2z_14fcITQfAZi0rjXH_Zebn6Ay6U7JJPxqEHjCDU,3032
|
|
43
|
+
cgse_common-0.16.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
44
|
+
cgse_common-0.16.5.dist-info/entry_points.txt,sha256=erQovXd1bGzsngB0_sfY7IYRNwHIhwq3K8fmQvGS12o,198
|
|
45
|
+
cgse_common-0.16.5.dist-info/RECORD,,
|
egse/env.py
CHANGED
|
@@ -573,6 +573,15 @@ def print_env():
|
|
|
573
573
|
console.print(f" {get_local_settings_env_name():{col_width}s}: {get_local_settings_path()}")
|
|
574
574
|
|
|
575
575
|
|
|
576
|
+
def bool_env(var_name: str) -> bool:
|
|
577
|
+
"""Return True if the environment variable is set to 1, true, yes, or on. All case-insensitive."""
|
|
578
|
+
|
|
579
|
+
if value := os.getenv(var_name):
|
|
580
|
+
return value.strip().lower() in {"1", "true", "yes", "on"}
|
|
581
|
+
|
|
582
|
+
return False
|
|
583
|
+
|
|
584
|
+
|
|
576
585
|
@contextlib.contextmanager
|
|
577
586
|
def env_var(**kwargs: str | int | float | bool | None):
|
|
578
587
|
"""
|
|
File without changes
|
|
File without changes
|