python-sdk-remote 0.0.65__py3-none-any.whl → 0.0.66__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.
- python_sdk_remote/mini_logger.py +2 -2
- python_sdk_remote/unified_json.py +12 -5
- python_sdk_remote/utilities.py +1 -0
- python_sdk_remote/valid_json_versions.py +1 -1
- python_sdk_remote/validate_environment.py +4 -2
- {python_sdk_remote-0.0.65.dist-info → python_sdk_remote-0.0.66.dist-info}/METADATA +1 -1
- python_sdk_remote-0.0.66.dist-info/RECORD +13 -0
- python_sdk_remote-0.0.65.dist-info/RECORD +0 -13
- {python_sdk_remote-0.0.65.dist-info → python_sdk_remote-0.0.66.dist-info}/WHEEL +0 -0
- {python_sdk_remote-0.0.65.dist-info → python_sdk_remote-0.0.66.dist-info}/top_level.txt +0 -0
python_sdk_remote/mini_logger.py
CHANGED
|
@@ -76,13 +76,13 @@ class MiniLogger:
|
|
|
76
76
|
f"{datetime.now()} - ERROR - {message} - {object}", file=sys.stderr)
|
|
77
77
|
|
|
78
78
|
@staticmethod
|
|
79
|
-
def exception(message: str = "", object: Exception = None):
|
|
79
|
+
def exception(message: str = "", object: Exception | dict = None):
|
|
80
80
|
"""
|
|
81
81
|
Print a log error message with the current time.
|
|
82
82
|
|
|
83
83
|
Parameters:
|
|
84
84
|
message (str): The message to be printed.
|
|
85
|
-
object (dict): The object to be printed.
|
|
85
|
+
object (dict / Exception): The object / Exception to be printed.
|
|
86
86
|
"""
|
|
87
87
|
if object is None:
|
|
88
88
|
print(f"{datetime.now()} - EXCEPTION - {message}", file=sys.stderr)
|
|
@@ -2,16 +2,23 @@ from .valid_json_versions import valid_json_versions
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class UnifiedJson:
|
|
5
|
-
def __init__(self, data: dict,
|
|
6
|
-
if
|
|
5
|
+
def __init__(self, data: dict, json_version: str):
|
|
6
|
+
if json_version not in valid_json_versions:
|
|
7
7
|
raise Exception(
|
|
8
|
-
f"version {
|
|
8
|
+
f"version {json_version} is not in valid_json_versions {valid_json_versions}, "
|
|
9
|
+
f"please make sure you run sql2code."
|
|
9
10
|
)
|
|
10
|
-
self.
|
|
11
|
+
self.json_version = json_version
|
|
11
12
|
self.data = data
|
|
12
13
|
|
|
13
14
|
def get_unified_json(self):
|
|
14
|
-
return {"version": self.
|
|
15
|
+
return {"version": self.json_version, "data": self.data}
|
|
16
|
+
|
|
17
|
+
def get_data(self):
|
|
18
|
+
return self.data
|
|
19
|
+
|
|
20
|
+
def get_json_version(self):
|
|
21
|
+
return self.json_version
|
|
15
22
|
|
|
16
23
|
def __str__(self):
|
|
17
24
|
return self.get_unified_json()
|
python_sdk_remote/utilities.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .constants import BRAND_NAME, ENVIRONMENT_NAME, LOGZIO_TOKEN
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
# TODO: I think this should be in logger-local, not here (akiva)
|
|
4
5
|
# TODO Align with https://github.com/circles-zone/typescript-sdk-remote-typescript-package/edit/dev/typescript-sdk/src/utils/index.ts validateTenantEnvironmentVariables() # noqa501
|
|
5
6
|
def validate_enviroment_variables(brand_name: str = BRAND_NAME, environment_name: str = ENVIRONMENT_NAME,
|
|
6
7
|
logzio_token: str = LOGZIO_TOKEN):
|
|
@@ -17,8 +18,9 @@ def validate_enviroment_variables(brand_name: str = BRAND_NAME, environment_name
|
|
|
17
18
|
|
|
18
19
|
def validate_environment_name(environment_name: str = ENVIRONMENT_NAME):
|
|
19
20
|
if environment_name is None:
|
|
20
|
-
raise Exception(
|
|
21
|
-
|
|
21
|
+
raise Exception(
|
|
22
|
+
"logger-local-python-package LoggerLocal.py in case of Play1 environment, please add Environment Variable called "
|
|
23
|
+
"ENVIRONMENT_NAME=local or play1 (instead of ENVIRONMENT)")
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
def validate_brand_name(brand_name: str = BRAND_NAME):
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
python_sdk_remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
python_sdk_remote/constants.py,sha256=x8lavZy0egJw9GGQBJlACrC5OjmpM174meeiLhbciII,962
|
|
3
|
+
python_sdk_remote/item.py,sha256=HnSLHkZTKTLNhlaZoPhKAwqG-yHPsd7zvqPPOqnrKVg,287
|
|
4
|
+
python_sdk_remote/mini_logger.py,sha256=ajBalf_chM027FkjIYRv6qi54RqK-bvSIwaQScEPIkc,2898
|
|
5
|
+
python_sdk_remote/our_object.py,sha256=7EA0E43GYJSc2C4ren-1pnALYWUJ2Wm9KQlHUFMpS_k,1997
|
|
6
|
+
python_sdk_remote/unified_json.py,sha256=z26ewUJIJg9duYVcfHMs29ZEJ1iZ6stSO84klKNYC7g,772
|
|
7
|
+
python_sdk_remote/utilities.py,sha256=u2VAco_-ZyB8Kly66eBPJfxygfNlRZ94QlMHt_7Kme4,11344
|
|
8
|
+
python_sdk_remote/valid_json_versions.py,sha256=-ZU65JYI6gTEfK8o6gu9Dmm9SQmwzj5pDbEXiyUbBhQ,138
|
|
9
|
+
python_sdk_remote/validate_environment.py,sha256=HI1Quey-EuaWU27o46F7wOi_qQ4Jpm_Olz_BVTxnXS8,1937
|
|
10
|
+
python_sdk_remote-0.0.66.dist-info/METADATA,sha256=rxr6dIqBvH1LT6NqcK_D45opGYfaUCiaMthx8poHXoI,536
|
|
11
|
+
python_sdk_remote-0.0.66.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
12
|
+
python_sdk_remote-0.0.66.dist-info/top_level.txt,sha256=JTpEq_svPlI5hTlPq30Ne-NkR-u5464gjVDP2U74PvE,18
|
|
13
|
+
python_sdk_remote-0.0.66.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
python_sdk_remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
python_sdk_remote/constants.py,sha256=x8lavZy0egJw9GGQBJlACrC5OjmpM174meeiLhbciII,962
|
|
3
|
-
python_sdk_remote/item.py,sha256=HnSLHkZTKTLNhlaZoPhKAwqG-yHPsd7zvqPPOqnrKVg,287
|
|
4
|
-
python_sdk_remote/mini_logger.py,sha256=Wq4lAfbqleXxlkIObb88_BsZmWymPcT5DLX1rNoxJNs,2867
|
|
5
|
-
python_sdk_remote/our_object.py,sha256=7EA0E43GYJSc2C4ren-1pnALYWUJ2Wm9KQlHUFMpS_k,1997
|
|
6
|
-
python_sdk_remote/unified_json.py,sha256=9qO-fuDtpGrCTmbBAklYrayk1lYoQzUr7RjDYnTE7NY,570
|
|
7
|
-
python_sdk_remote/utilities.py,sha256=YyiRjwUdPF4O9ClYnBa_z9nX7oGnV_aqUbu2FFy3lF0,11293
|
|
8
|
-
python_sdk_remote/valid_json_versions.py,sha256=vUU8yxRyjxMJQHVAPzI_wz3BrIuoly8e49oxOUxCXdo,123
|
|
9
|
-
python_sdk_remote/validate_environment.py,sha256=7B-qtV7vYWTHYOKpjG_d1gWUpmiGASxrm0T7KzzpMtk,1841
|
|
10
|
-
python_sdk_remote-0.0.65.dist-info/METADATA,sha256=O3Nqd0bqro57UNnDSwSSiJXEtyNBJHiImECNELyVcwQ,536
|
|
11
|
-
python_sdk_remote-0.0.65.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
12
|
-
python_sdk_remote-0.0.65.dist-info/top_level.txt,sha256=JTpEq_svPlI5hTlPq30Ne-NkR-u5464gjVDP2U74PvE,18
|
|
13
|
-
python_sdk_remote-0.0.65.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|