配置工具类
Project description
配置加载类使用说明
为部署的应用提供统一的配置文件解析接口。根据不同的应用名称生成不同的配置文件路径。并将其配置文件加载。
对一个应用appname,在Linux操作系统下,配置文件路径依次为
- /etc/
appname.ini - ${HOME}/etc/
appname.ini - ${PROJECT_HOME}/etc.ini
在Windows下,配置文件的路径依次为
- %ProgramData%/
appname.ini - %APPDATA%/
appname.ini - %PROJECT_HOME%/etc.ini
其中第三个路径为测试用的路径。后面的配置文件覆盖前面的配置。
类说明
该包提供类ConfigDict。其初始化函数接收一个参数appname。包含一个帮助方法self.show(),用以查看当前应用的配置文件路径。初始化完成后,ConfigDict的对象实例自动加载了所有的配置文件,以字典的形式存储在对象中。
config = ConfigDict(appname='app')
config.show()
print(config)
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meca_common_config-1.0.4.tar.gz.
File metadata
- Download URL: meca_common_config-1.0.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce1b15974136c5d097e37921d29cd6eeea729fcc4ea83054ae0d069657e87a00
|
|
| MD5 |
6272eb81ace99641d12f776697c264bc
|
|
| BLAKE2b-256 |
25e2b0f459a9f35d17285d46f9159a1973298ed1d1a58b39162ec6429f2cb017
|
File details
Details for the file meca_common_config-1.0.4-py3-none-any.whl.
File metadata
- Download URL: meca_common_config-1.0.4-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c9fefb4df37f8729276406fd5ff389476e9c4ec5776ebb1b5cbad429583825d
|
|
| MD5 |
44409c06060935aa474627d005cb5f79
|
|
| BLAKE2b-256 |
e8bf825316a35d9fa61ff99c5c58d1fa392afa9f6154259199554c2cee8e05dc
|