Lines 306-312
Link Here
|
306 |
return (newfile, StringIO.StringIO()) |
306 |
return (newfile, StringIO.StringIO()) |
307 |
|
307 |
|
308 |
def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True): |
308 |
def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True): |
309 |
mykeys={} |
309 |
if isinstance(expand, dict): |
|
|
310 |
# Some existing variable definitions have been |
311 |
# passed in, for use in substitutions. |
312 |
expand_map = expand |
313 |
expand = True |
314 |
else: |
315 |
expand_map = {} |
316 |
mykeys = {} |
310 |
try: |
317 |
try: |
311 |
f=open(mycfg,'r') |
318 |
f=open(mycfg,'r') |
312 |
except IOError, e: |
319 |
except IOError, e: |
Lines 365-371
Link Here
|
365 |
else: |
372 |
else: |
366 |
return mykeys |
373 |
return mykeys |
367 |
if expand: |
374 |
if expand: |
368 |
mykeys[key] = varexpand(val, mykeys) |
375 |
mykeys[key] = varexpand(val, expand_map) |
|
|
376 |
expand_map[key] = mykeys[key] |
369 |
else: |
377 |
else: |
370 |
mykeys[key] = val |
378 |
mykeys[key] = val |
371 |
except SystemExit, e: |
379 |
except SystemExit, e: |