iniUts 1.2.0__tar.gz → 1.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iniUts
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Ini file manipulator
5
5
  Home-page:
6
6
  Author: Melque Lima
@@ -169,8 +169,13 @@ class IniUts():
169
169
  v = self.format_data(dtClass,k,dt2[k])
170
170
  setattr(dtClass, k, v)
171
171
  else:
172
- if not skip_missing and MissingKeysFromClass(dt):
173
- raise Exception(f"Cound not find '{MissingKeysFromClass(dt)}' keys at section '{section}' in ini file")
172
+ for k in MissingKeysFromClass(dt):
173
+ if isinstance(getattr(dtClass,k),envar):
174
+ v = getattr(dtClass,k).get_value()
175
+ setattr(dtClass, k, v)
176
+ continue
177
+ if not skip_missing and MissingKeysFromClass(dt):
178
+ raise Exception(f"Cound not find '{k}' keys at section '{section}' in ini file")
174
179
 
175
180
  def link(self,section,skip_missing=False,empty_as_null=False):
176
181
  def wrap(function):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iniUts
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Ini file manipulator
5
5
  Home-page:
6
6
  Author: Melque Lima
@@ -7,14 +7,14 @@ from iniUts import *
7
7
  load_dotenv()
8
8
 
9
9
  ini = IniUts('prd_config.ini')
10
- ini = IniUts('prd_config.ini','dev_config.ini',in_prd=False)
10
+ ini = IniUts('prd_config.ini','dev_config.ini',in_prd=True)
11
11
 
12
12
  #TODAS AS CHAVES DE DEV DEVE CONTER EM PRD
13
13
 
14
14
 
15
15
  @ini.link('PERSON')
16
16
  class Person():
17
- USERNAME: str = envar("USERNAME")
17
+ USERNAME: str = envar("USERNAME","NO_NAME")
18
18
  NAME : str
19
19
  age : int
20
20
  amount : float
@@ -10,7 +10,7 @@ classifiers = [
10
10
 
11
11
  setup(
12
12
  name='iniUts',
13
- version='1.2.0',
13
+ version='1.2.1',
14
14
  description='Ini file manipulator',
15
15
  long_description=open('README.md').read() + '\n\n' + open('CHANGELOG.txt').read(),
16
16
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes