forked from smarthaut/Daemon_AutoFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
30 lines (24 loc) · 887 Bytes
/
Copy pathconfig.py
File metadata and controls
30 lines (24 loc) · 887 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/4/11 10:58
# @Author : huanghe
# @Site :
# @File : config.py
# @Software: PyCharm
import os
from src.utils.file_reader import YamlReader
BASE_PATH = os.path.split(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))[0]
CONFIG_FILE = os.path.join(BASE_PATH, 'config', 'config.yml')
LOG_PATH = os.path.join(BASE_PATH, 'log')
PIR_PATH = os.path.join(BASE_PATH,'report','screenpicture\\')
DATA_PATH = os.path.join(BASE_PATH,'data','baidu.xlsx')
DRIVER_PATH = os.path.join(BASE_PATH,'drivers')
MONGOD_PATH = os.path.join(BASE_PATH,'config','db_config.ini')
class Config:
def __init__(self,config=CONFIG_FILE):
self.config = YamlReader(config).data
def get(self,element,index=0):
return self.config[index].get(element)
if __name__ == '__main__':
c = Config()
print(BASE_PATH)