mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-17 02:01:13 +00:00
py-i2phosts-checker: read config with configobj module
This commit is contained in:
parent
76e6685a15
commit
cf5e82c65f
@ -8,6 +8,7 @@ import datetime
|
||||
import time
|
||||
import hashlib
|
||||
import base64
|
||||
import configobj
|
||||
|
||||
from i2p import samclasses
|
||||
from i2p import socket
|
||||
@ -29,6 +30,11 @@ parser.add_argument('-c', '--config', default='/etc/py-i2phosts/checker.conf', d
|
||||
help='config file to use')
|
||||
args = parser.parse_args()
|
||||
|
||||
# read config
|
||||
config = configobj.ConfigObj(args.config_file, file_error=True)
|
||||
config_included = configobj.ConfigObj(config['include'])
|
||||
config.merge(config_included)
|
||||
|
||||
# configure logger
|
||||
log = logging.getLogger(sys.argv[0])
|
||||
handler = logging.StreamHandler()
|
||||
|
Loading…
x
Reference in New Issue
Block a user