A basic application class which other applications can inherit.
Project description
The psionapp package provides a basis for defining, saving, and retrieving application-level and user-level configuration variables (attributes).
The package exposes two classes: ApplicationClass and ApplicationUser.
ApplicationClass
An ApplicationClass object will define the application-level configuration (if any).
An ApplicationClass object will be identified by an application id. You can instantiate a class object with the following parameters:
-
use_user_ini (bool). If True this will create a .ini file in the system appropriate config directory. Initially a file will be created for the current system user's user name. This will store user-level configuration values.
-
use_config_ini (bool). If True this will create a config.ini file in the system appropriate config directory. This will store application-level configuration values.
-
use_var_dir (bool). If True this will create an application id directory in the system appropriate var data directory.
-
user_class (ApplicationUser). Used in conjunction with use_user_ini. The ApplicationUser class will define the config parameters.
-
attributes (see Attribute definition)
ApplicationUser
An ApplicationUser object will define the user-level configuration (if any).
An ApplicationUser class will be identified by a user name. It will define the attributes that will form that user's configuration values.
Attribute definition
Attibutes must be defined in the form:
attributes = {
'string_data': ('general', 'string', 'abc'),
'int_data': ('general', 'int', 2),
'bool_data': ('display', 'bool', True),
'float_data': ('display', 'float', 1.23456),
}
where the attributes dict key is the attribute name, and the three tuple values are:
- the section in the config file where the attribute will appear;
- the data type of the attribute;
- the default value of the attribute.
Version 0.0.5 - 21 January 2021
- Dummy
Version 0.0.4 - 14 August 2020
- include download path
Version 0.0.3 - 3 August 2020
- refactor application last_user
Version 0.0.2 - 2 August 2020
- remove _applicationbase
- refactor user creation and save
- refactor applicationclass
Version 0.0.1 - 1 August 2020
- Added version and _all_
- Added App level attributes
- Added README
Version 0.0.0 - 30 July 2020
Created and uploaded
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file psionapp-0.0.5.tar.gz
.
File metadata
- Download URL: psionapp-0.0.5.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e933ac345df23b640fbb44f63144ce88cddef3d0eaf27ad92db50eabe6171644 |
|
MD5 | 1a929f091cadda5ca032c7aa8cf9a736 |
|
BLAKE2b-256 | ad2219e06fa160510bfa49b150d81bc43670266783a966f41e836c4efefc429f |
File details
Details for the file psionapp-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: psionapp-0.0.5-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3405b65cf7f41fec64f9411ddd5e9c37c799ced1287a064679d2e9e16b9d4685 |
|
MD5 | 3fb4ffbb318ec80144d25cfb4a698a14 |
|
BLAKE2b-256 | 1e3d53798255278093e7acdb75e82dc3ce1464c883fa45eb7f8ac77e15a78786 |