appsettings2 2.1.3__tar.gz → 2.1.4__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.
- {appsettings2-2.1.3/src/appsettings2.egg-info → appsettings2-2.1.4}/PKG-INFO +1 -1
- {appsettings2-2.1.3 → appsettings2-2.1.4}/pyproject.toml +1 -1
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/Configuration.py +17 -1
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/SKILL.md +2 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/__init__.py +2 -2
- {appsettings2-2.1.3 → appsettings2-2.1.4/src/appsettings2.egg-info}/PKG-INFO +1 -1
- {appsettings2-2.1.3 → appsettings2-2.1.4}/LICENSE +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/README.md +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/setup.cfg +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/ConfigurationBuilder.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/ConfigurationException.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/ConfigurationWatcher.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/helpers.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/CommandLineConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/ConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/EnvironmentConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/JsonConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/TomlConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/YamlConfigurationProvider.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/__init__.py +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/py.typed +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2.egg-info/SOURCES.txt +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2.egg-info/dependency_links.txt +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2.egg-info/requires.txt +0 -0
- {appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: appsettings2
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.4
|
|
4
4
|
Summary: ..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data.
|
|
5
5
|
Author-email: Shaun Wilson <mrshaunwilson@msn.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "appsettings2"
|
|
3
|
-
version = "2.1.
|
|
3
|
+
version = "2.1.4"
|
|
4
4
|
description = "..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data."
|
|
5
5
|
keywords = ["appsettings", "configuration"]
|
|
6
6
|
authors = [
|
|
@@ -585,8 +585,13 @@ class Configuration:
|
|
|
585
585
|
"""
|
|
586
586
|
Set the configuration value for a configuration key.
|
|
587
587
|
|
|
588
|
-
:param key: The *key* to associate the configuration *value*.
|
|
588
|
+
:param key: The *key* to associate the configuration *value*. Supports `__` and `:` hierarchical delimiters.
|
|
589
589
|
:param value: The *value* to be associated with the configuration *key*.
|
|
590
|
+
|
|
591
|
+
Intermediate segments of a hierarchical key are created as nested
|
|
592
|
+
:py:class:`~appsettings2.Configuration` objects as needed. If an
|
|
593
|
+
intermediate segment already holds a non-``Configuration`` value
|
|
594
|
+
(e.g. a scalar or list), it is replaced by a new ``Configuration``.
|
|
590
595
|
"""
|
|
591
596
|
if self.__normalize:
|
|
592
597
|
key = key.upper()
|
|
@@ -608,6 +613,12 @@ class Configuration:
|
|
|
608
613
|
o = c
|
|
609
614
|
else:
|
|
610
615
|
o = getattr(self, self.__scrub_key(k))
|
|
616
|
+
if not isinstance(o, Configuration):
|
|
617
|
+
c = Configuration(normalize=self.__normalize, scrubkeys=(
|
|
618
|
+
self.__key_scrub_re is None))
|
|
619
|
+
setattr(self, self.__scrub_key(k), c)
|
|
620
|
+
self.__add_child_change_handler(parts[i])
|
|
621
|
+
o = c
|
|
611
622
|
else:
|
|
612
623
|
if not o.has_key(parts[i]):
|
|
613
624
|
c = Configuration(normalize=self.__normalize, scrubkeys=(
|
|
@@ -616,6 +627,11 @@ class Configuration:
|
|
|
616
627
|
o = c
|
|
617
628
|
else:
|
|
618
629
|
o = o.get(parts[i])
|
|
630
|
+
if not isinstance(o, Configuration):
|
|
631
|
+
c = Configuration(normalize=self.__normalize, scrubkeys=(
|
|
632
|
+
self.__key_scrub_re is None))
|
|
633
|
+
o.set(parts[i], c)
|
|
634
|
+
o = c
|
|
619
635
|
|
|
620
636
|
# Convert dict/list values
|
|
621
637
|
vtype = type(value)
|
|
@@ -124,6 +124,8 @@ config.set('Section__Key', 'value') # hierarchical key
|
|
|
124
124
|
config['Section__Key'] = 'value' # same via setter
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
Intermediate segments are created as nested `Configuration` objects as needed; if an intermediate segment already holds a non-`Configuration` value (scalar/list), it is replaced by a new `Configuration`.
|
|
128
|
+
|
|
127
129
|
### Other members
|
|
128
130
|
|
|
129
131
|
| Member | Signature | Description |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: appsettings2
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.4
|
|
4
4
|
Summary: ..unify configuration sources into a `Configuration` object that can be bound to complex types, or accessed directly for configuration data.
|
|
5
5
|
Author-email: Shaun Wilson <mrshaunwilson@msn.com>
|
|
6
6
|
License-Expression: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/ConfigurationProvider.py
RENAMED
|
File without changes
|
|
File without changes
|
{appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/JsonConfigurationProvider.py
RENAMED
|
File without changes
|
{appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/TomlConfigurationProvider.py
RENAMED
|
File without changes
|
{appsettings2-2.1.3 → appsettings2-2.1.4}/src/appsettings2/providers/YamlConfigurationProvider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|