config.py

changeset 31
b4b4bb7a2ec5
parent 30
3dd525652dc8
child 33
91421eeb4426
equal deleted inserted replaced
30:3dd525652dc8 31:b4b4bb7a2ec5
8 import os 8 import os
9 import xdg 9 import xdg
10 import string 10 import string
11 import logging 11 import logging
12 from functools import reduce 12 from functools import reduce
13
14 logger=logging.getLogger(__name__)
13 15
14 # 16 #
15 # Defaults 17 # Defaults
16 # 18 #
17 19
122 124
123 return out 125 return out
124 126
125 cfgfile=os.path.join(xdg.XDG_CONFIG_HOME, "borgend", "config.yaml") 127 cfgfile=os.path.join(xdg.XDG_CONFIG_HOME, "borgend", "config.yaml")
126 128
127 logging.info("Reading configuration file %s" % cfgfile) 129 logger.info("Reading configuration file %s" % cfgfile)
128 130
129 if not (os.path.exists(cfgfile) and os.path.isfile(cfgfile)): 131 if not (os.path.exists(cfgfile) and os.path.isfile(cfgfile)):
130 raise SystemExit('Configuration file required: {cfgfile}') 132 raise SystemExit('Configuration file required: {cfgfile}')
131 133
132 with io.open(cfgfile, 'r') as file: 134 with io.open(cfgfile, 'r') as file:

mercurial