3
3
-------------------------------------------------
4
4
File Name: config
5
5
Description :
6
- Author : klook
6
+ Author : vant
7
7
date: 2021/5/26
8
8
-------------------------------------------------
9
9
Change Activity:
10
- 2021 /5/26 :
10
+ 2022 /5/09 :
11
11
-------------------------------------------------
12
12
"""
13
- __author__ = 'klook '
13
+ __author__ = 'vant '
14
14
15
15
import configparser
16
16
import os
17
17
18
+
18
19
class Config :
19
- def __init__ (self ):
20
- BASE_PATH = os .path .split (os .path .dirname (os .path .abspath (__file__ )))[0 ]
21
- CONFIG_FILE = os .path .join (BASE_PATH , 'data' , 'config.ini' )
22
- self .config = configparser .ConfigParser ()
23
- self .config .read (CONFIG_FILE )
20
+ def __init__ (self ):
21
+ BASE_PATH = os .path .split (os .path .dirname (os .path .abspath (__file__ )))[0 ]
22
+ CONFIG_FILE = os .path .join (BASE_PATH , 'data' , 'config.ini' )
23
+ self .config = configparser .ConfigParser ()
24
+ self .config .read (CONFIG_FILE )
25
+
26
+ def get (self , filename , key ):
27
+ conf = self .config .get (filename , key )
28
+ return conf
24
29
25
- def get (self , filename , key ):
26
- conf = self . config . get ( filename , key )
27
- return conf
30
+ def path (self ):
31
+ BASE_PATH = os . path . split ( os . path . dirname ( os . path . abspath ( __file__ )))[ 0 ]
32
+ return BASE_PATH
28
33
29
- def path (self ):
30
- BASE_PATH = os .path .split (os .path .dirname (os .path .abspath (__file__ )))[0 ]
31
- return BASE_PATH
32
34
33
35
if __name__ == '__main__' :
34
- c = Config ()
35
- # print(c.path())
36
- # print(c.get('browserType','browserName'))
36
+ c = Config ()
37
+ print (c .path ())
38
+ # print(c.get('browserType','browserName'))
0 commit comments