123456789101112131415161718192021222324252627282930313233343536373839 |
- # Author renyupeng
- # coding=utf-8
- # @Time : 2021/9/15 11:14 上午
- # @Site :
- # @File : ConfConstant.py
- # @Software: PyCharm
- # @contact: renyupeng@c-top.com.cn
- # @Tel 1501435553
- import os
- from configparser import ConfigParser
- dir_name = os.path.dirname(os.path.dirname(__file__))
- config_file = dir_name + '/config.ini'
- _cfp = ConfigParser()
- _cfp.read(config_file, encoding='utf-8')
- class ConfConstant:
- """
- 配置文件常量类
- """
- # tidb 配置信息
- TIDB_HOST = _cfp.get('tidb', 'tidb_host')
- TIDB_PORT = _cfp.getint('tidb', 'tidb_port')
- TIDB_USER = _cfp.get('tidb', 'tidb_user')
- TIDB_PASSWORD = _cfp.get('tidb', 'tidb_password')
- # xxl-job 配置
- xxl_url = _cfp.get('xxl_job', 'xxl_url')
- # ### log
- # # 日志存放路径
- # LOG_DIR = _cfp.get('log', 'log_dir')
- # # 日志等级
- # LOG_LEVEL = _cfp.get('log', 'log_level')
- # webhook配置
- URL = _cfp.get('webhook', 'url')
|