-
Notifications
You must be signed in to change notification settings - Fork 2
/
setting.py
32 lines (25 loc) · 962 Bytes
/
setting.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import yaml
import platform
import logging
import logging.config
import os
# 多线程线程数
THREAD_NUM = 2
def logger_conf():
"""
load basic logger configure
:return: configured logger
"""
if platform.system() == 'Windows':
logging.config.fileConfig(os.path.split(os.path.realpath(__file__))[0]+'\\conf\\logging.conf')
elif platform.system() == 'Linux':
logging.config.fileConfig(os.path.split(os.path.realpath(__file__))[0]+'/conf/logging.conf')
elif platform.system() == 'Darwin':
logging.config.fileConfig(os.path.split(os.path.realpath(__file__))[0] + '/conf/logging.conf')
logger = logging.getLogger('simpleLogger')
return logger
if __name__ == 'setting':
ROOT_PATH = os.path.split(os.path.realpath(__file__))[0]
LOGGER = logger_conf()
PROPERTIES = yaml.load(open(os.path.split(os.path.realpath(__file__))[0] + '/conf/weibo.yaml'))
ACCOUNTS = PROPERTIES.get('accounts')