Manage configuration settings for WhakerKit.
This class handles loading settings from a configuration file and provides access to key attributes such as secret keys and additional configuration options.
This class also defines default naming conventions and rules for folders and files, including separators, minimum name lengths, and invalid characters. Once initialized, the settings become immutable, enforcing consistency throughout the application. The class also supports context management, allowing temporary changes using the 'with' statement. These attributes are:
- FOLDERNAMESEPARATOR (str): Character used to separate parts of a folder name.
- FIELDSNAMESEPARATOR (str): Character used to separate fields within a folder name.
- MINFILENAME_LENGTH (int): Minimum length required for a valid file name.
- INVALIDCHARSFOR_FOLDERS (str): String of characters that are disallowed in folder names.
- INVALIDCHARSFOR_FIELDS (str): String of characters that are disallowed in file names.
- DOWNLOADS_FILENAME (str): Default name for the downloads file.
- DESCRIPTION_FILENAME (str): Default name for the description file.
Example
>>> with WhakerKitSettings() as settings:
>>> print(settings.name)
> "WhakerKit"
>>> settings.foo = 'bar' # raise AttributeError
>>> del settings.name # raise AttributeError