comparison src/cagou/core/cagou_main.py @ 89:d249df379fa3

core: kv files are not mandatory anymore for plugins
author Goffi <goffi@goffi.org>
date Sun, 25 Dec 2016 22:53:52 +0100
parents 17094a075fd2
children 520a9e1a659b
comparison
equal deleted inserted replaced
88:3dc526bb4a5a 89:d249df379fa3
447 447
448 # we need to load the kv file 448 # we need to load the kv file
449 if 'kv_file' not in plugin_info: 449 if 'kv_file' not in plugin_info:
450 plugin_info['kv_file'] = u'{}.kv'.format(plug) 450 plugin_info['kv_file'] = u'{}.kv'.format(plug)
451 kv_path = os.path.join(plugins_path, plugin_info['kv_file']) 451 kv_path = os.path.join(plugins_path, plugin_info['kv_file'])
452 Builder.load_file(kv_path) 452 if not os.path.exists(kv_path):
453 log.debug(u"no kv found for {plugin_file}".format(**plugin_info))
454 else:
455 Builder.load_file(kv_path)
453 456
454 # what is the main class ? 457 # what is the main class ?
455 main_cls = getattr(mod, plugin_info['main']) 458 main_cls = getattr(mod, plugin_info['main'])
456 plugin_info['main'] = main_cls 459 plugin_info['main'] = main_cls
457 460