Exemplo n.º 1
0
    获取int值
    :param section:
    :param key:
    :return:
    """
    return cf.getint(section, key)


const = Const()
"""GLOBAL"""
const.GLOBAL_DELETE_SOURCE_FILE = get_int('global', 'delete_source_file') == 1
const.GLOBAL_INTERVAL = get_int('global', 'interval')
const.GLOBAL_LOGLEVEL = get_str('global', 'log_level')
const.GLOBAL_IGNORE = get_str('global', 'ignore').split(",")
const.GLOBAL_NAME_REPLACE = get_str('global', 'name_replace').split(",")
const.GLOBAL_VIDEO_SUFFIX = get_str('global', 'video_suffix').split(",")
"""SAMBA"""
const.SAMBA_HOST = get_str('samba', 'host')
const.SAMBA_PORT = get_int('samba', 'port')
const.SAMBA_USERNAME = get_str('samba', 'username')
const.SAMBA_PASSWORD = get_str('samba', 'password')
const.SAMBA_SERVICE_NAME = get_str('samba', 'service_name')
const.SAMBA_PATH = get_str('samba', 'path')
"""STORE"""
const.STORE_PATH = get_str("store", "path")

logging.basicConfig(
    level=const.GLOBAL_LOGLEVEL,
    stream=sys.stdout,
    format='%(asctime)s - %(thread)d - %(levelname)s - %(message)s')