appsettings2 2.1.0__tar.gz → 2.1.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.
Files changed (25) hide show
  1. {appsettings2-2.1.0/src/appsettings2.egg-info → appsettings2-2.1.1}/PKG-INFO +1 -1
  2. {appsettings2-2.1.0 → appsettings2-2.1.1}/pyproject.toml +1 -1
  3. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/ConfigurationWatcher.py +18 -18
  4. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/__init__.py +2 -2
  5. {appsettings2-2.1.0 → appsettings2-2.1.1/src/appsettings2.egg-info}/PKG-INFO +1 -1
  6. {appsettings2-2.1.0 → appsettings2-2.1.1}/LICENSE +0 -0
  7. {appsettings2-2.1.0 → appsettings2-2.1.1}/README.md +0 -0
  8. {appsettings2-2.1.0 → appsettings2-2.1.1}/setup.cfg +0 -0
  9. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/Configuration.py +0 -0
  10. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/ConfigurationBuilder.py +0 -0
  11. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/ConfigurationException.py +0 -0
  12. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/SKILL.md +0 -0
  13. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/helpers.py +0 -0
  14. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/CommandLineConfigurationProvider.py +0 -0
  15. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/ConfigurationProvider.py +0 -0
  16. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/EnvironmentConfigurationProvider.py +0 -0
  17. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/JsonConfigurationProvider.py +0 -0
  18. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/TomlConfigurationProvider.py +0 -0
  19. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/YamlConfigurationProvider.py +0 -0
  20. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/providers/__init__.py +0 -0
  21. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2/py.typed +0 -0
  22. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2.egg-info/SOURCES.txt +0 -0
  23. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2.egg-info/dependency_links.txt +0 -0
  24. {appsettings2-2.1.0 → appsettings2-2.1.1}/src/appsettings2.egg-info/requires.txt +0 -0
  25. {appsettings2-2.1.0 → appsettings2-2.1.1}/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.0
3
+ Version: 2.1.1
4
4
  Summary: Unifies 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.0"
3
+ version = "2.1.1"
4
4
  description = "Unifies 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 = [
@@ -87,7 +87,7 @@ class ConfigurationWatcher:
87
87
  self.__handler_lock = threading.Lock()
88
88
  self.__logger = logging.getLogger(__name__)
89
89
 
90
- def add_watch(self, filepath: str) -> None:
90
+ def add_watch(self, filepath: str) -> ConfigurationWatcher:
91
91
  """Add a file path to be watched for changes.
92
92
 
93
93
  The path is normalised to a fully-qualified (canonical) path via
@@ -100,18 +100,18 @@ class ConfigurationWatcher:
100
100
  resolved = os.path.realpath(filepath)
101
101
  with self.__lock:
102
102
  is_first_watch = len(self.__watches) == 0
103
- if resolved in self.__watches:
104
- return
105
- self.__watches[resolved] = {
106
- 'path': resolved,
107
- 'size': None,
108
- 'mtime': None,
109
- 'state': 'pending',
110
- }
111
- if is_first_watch:
112
- self.__start_thread()
113
-
114
- def remove_watch(self, filepath: str) -> None:
103
+ if resolved not in self.__watches:
104
+ self.__watches[resolved] = {
105
+ 'path': resolved,
106
+ 'size': None,
107
+ 'mtime': None,
108
+ 'state': 'pending',
109
+ }
110
+ if is_first_watch:
111
+ self.__start_thread()
112
+ return self
113
+
114
+ def remove_watch(self, filepath: str) -> ConfigurationWatcher:
115
115
  """Remove a previously added watch.
116
116
 
117
117
  Silently does nothing if the watch does not exist. The polling thread
@@ -122,11 +122,11 @@ class ConfigurationWatcher:
122
122
  """
123
123
  resolved = os.path.realpath(filepath)
124
124
  with self.__lock:
125
- if resolved not in self.__watches:
126
- return
127
- del self.__watches[resolved]
128
- if len(self.__watches) == 0 and self.__thread is not None:
129
- self.__drain_thread()
125
+ if resolved in self.__watches:
126
+ del self.__watches[resolved]
127
+ if len(self.__watches) == 0 and self.__thread is not None:
128
+ self.__drain_thread()
129
+ return self
130
130
 
131
131
  def list_watches(self) -> list[str]:
132
132
  """Return a fresh list of all currently watched file paths.
@@ -11,8 +11,8 @@ from . import helpers
11
11
  from . import providers
12
12
 
13
13
 
14
- __version__ = '2.1.0'
15
- __commit__ = 'a6890cf'
14
+ __version__ = '2.1.1'
15
+ __commit__ = 'ec3a50a'
16
16
  __all__ = [
17
17
  '__version__', '__commit__',
18
18
  'Configuration',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: appsettings2
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Unifies 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