iwla

iwla Commit Details

Date:2015-02-19 20:15:03 (6 years 5 months ago)
Author:Grégory Soutadé
Branch:dev, master
Commit:bca4b8661edcce0122de4b585a84f875a740380f
Parents: 1f6154107cb04f5448b6abc149de085ecbe5f4a7
Message:We can now use _append suffix un conf.py to append a value to a default configuration instead of reapeating whole configuration

Changes:
Miwla.py (2 diffs)

File differences

iwla.py
3434
3535
3636
37
38
39
37
4038
4139
4240
......
735733
736734
737735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
738753
739754
740755
from datetime import date, datetime
import default_conf as conf
import conf as _
conf.__dict__.update(_.__dict__)
del _
import conf as user_conf
from iplugin import *
from display import *
args = parser.parse_args()
# Load user conf
for (k,v) in user_conf.__dict__.items():
if k.endswith('_append'):
new_k = k[:-7]
if new_k in dir(conf):
if type(conf.__dict__[new_k]) == list:
if type(v) == list:
conf.__dict__[new_k] += v
else:
conf.__dict__[new_k].append(v)
else:
self.logger.error("%s is not a list" % (new_k))
else:
self.logger.error("%s doesn't exists in default conf" % (new_k))
else:
conf.__dict__.update({k:v})
if args.clean_output:
if os.path.exists(conf.DB_ROOT): shutil.rmtree(conf.DB_ROOT)
if os.path.exists(conf.DISPLAY_ROOT): shutil.rmtree(conf.DISPLAY_ROOT)

Archive Download the corresponding diff file

Branches

Tags