[enh] skipping empty/nonetype categories

This commit is contained in:
asciimoo 2013-11-04 21:46:23 +01:00
parent 4cc391169a
commit 1a2cf205f9
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ for section in engines_config.sections():
if param_name == 'engine': if param_name == 'engine':
continue continue
if param_name == 'categories': if param_name == 'categories':
engine.categories = map(str.strip, engines_config.get(section, param_name).split(',')) if engines_config.get(section, param_name) == 'none':
engine.categories = []
else:
engine.categories = map(str.strip, engines_config.get(section, param_name).split(','))
continue continue
setattr(engine, param_name, engines_config.get(section, param_name)) setattr(engine, param_name, engines_config.get(section, param_name))
for engine_attr in dir(engine): for engine_attr in dir(engine):