konecty-sdk-python 1.2.2__tar.gz → 1.2.3__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.
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/settings.py +16 -16
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/PKG-INFO +1 -1
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/pyproject.toml +1 -1
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/.gitignore +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/__init__.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/cli/__init__.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/cli/apply.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/cli/backup.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/cli/pull.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/__init__.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/client.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/file_manager.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/filters.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/model.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/KonectySdkPython/lib/types.py +0 -0
- {konecty_sdk_python-1.2.2 → konecty_sdk_python-1.2.3}/README.md +0 -0
|
@@ -61,11 +61,8 @@ async def fill_settings(settings_class: Type[T]) -> T:
|
|
|
61
61
|
# Primeiro verifica variáveis de ambiente e coleta campos que precisam ser buscados no Konecty
|
|
62
62
|
for field_name in settings_class.model_fields.keys():
|
|
63
63
|
field = settings_class.model_fields[field_name]
|
|
64
|
-
field_str = (
|
|
65
|
-
|
|
66
|
-
if field.validation_alias
|
|
67
|
-
else field.alias if field.alias else field_name
|
|
68
|
-
)
|
|
64
|
+
field_str = get_field_name(field, field_name)
|
|
65
|
+
|
|
69
66
|
env_value = os.getenv(field_str.upper())
|
|
70
67
|
if env_value is not None and env_value.strip():
|
|
71
68
|
field_type = field.annotation
|
|
@@ -83,11 +80,8 @@ async def fill_settings(settings_class: Type[T]) -> T:
|
|
|
83
80
|
|
|
84
81
|
for field_name in settings_class.model_fields.keys():
|
|
85
82
|
field = settings_class.model_fields[field_name]
|
|
86
|
-
field_str = (
|
|
87
|
-
|
|
88
|
-
if field.validation_alias
|
|
89
|
-
else field.alias if field.alias else field_name
|
|
90
|
-
)
|
|
83
|
+
field_str = get_field_name(field, field_name)
|
|
84
|
+
|
|
91
85
|
value = konecty_settings.get(field_str.upper())
|
|
92
86
|
if value is not None and value.strip():
|
|
93
87
|
field_type = field.annotation
|
|
@@ -117,9 +111,12 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
117
111
|
|
|
118
112
|
# Primeiro verifica variáveis de ambiente e coleta campos que precisam ser buscados no Konecty
|
|
119
113
|
for field_name in settings_class.model_fields.keys():
|
|
120
|
-
|
|
114
|
+
field = settings_class.model_fields[field_name]
|
|
115
|
+
field_str = get_field_name(field, field_name)
|
|
116
|
+
|
|
117
|
+
env_value = os.getenv(field_str.upper())
|
|
121
118
|
if env_value is not None and env_value.strip():
|
|
122
|
-
field_type =
|
|
119
|
+
field_type = field.annotation
|
|
123
120
|
converted_value = _convert_value(env_value, field_type)
|
|
124
121
|
if converted_value is not None:
|
|
125
122
|
settings_dict[field_name] = converted_value
|
|
@@ -134,9 +131,12 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
134
131
|
)
|
|
135
132
|
|
|
136
133
|
for field_name in settings_class.model_fields.keys():
|
|
137
|
-
|
|
134
|
+
field = settings_class.model_fields[field_name]
|
|
135
|
+
field_str = get_field_name(field, field_name)
|
|
136
|
+
|
|
137
|
+
value = konecty_settings.get(field_str.upper())
|
|
138
138
|
if value is not None and value.strip():
|
|
139
|
-
field_type =
|
|
139
|
+
field_type = field.annotation
|
|
140
140
|
converted_value = _convert_value(value, field_type)
|
|
141
141
|
if converted_value is not None:
|
|
142
142
|
settings_dict[field_name] = converted_value
|
|
@@ -144,9 +144,9 @@ def fill_settings_sync(settings_class: Type[T]) -> T:
|
|
|
144
144
|
return settings_class.model_construct(**settings_dict)
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
def get_field_name(field) -> str:
|
|
147
|
+
def get_field_name(field, default: str = None) -> str:
|
|
148
148
|
return (
|
|
149
149
|
field.validation_alias
|
|
150
150
|
if field.validation_alias
|
|
151
|
-
else field.alias if field.alias else
|
|
151
|
+
else field.alias if field.alias else default
|
|
152
152
|
)
|
|
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
|