diff 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
line wrap: on
line diff
--- a/src/cagou/core/cagou_main.py	Sun Dec 25 22:53:50 2016 +0100
+++ b/src/cagou/core/cagou_main.py	Sun Dec 25 22:53:52 2016 +0100
@@ -449,7 +449,10 @@
             if 'kv_file' not in plugin_info:
                 plugin_info['kv_file'] = u'{}.kv'.format(plug)
             kv_path = os.path.join(plugins_path, plugin_info['kv_file'])
-            Builder.load_file(kv_path)
+            if not os.path.exists(kv_path):
+                log.debug(u"no kv found for {plugin_file}".format(**plugin_info))
+            else:
+                Builder.load_file(kv_path)
 
             # what is the main class ?
             main_cls = getattr(mod, plugin_info['main'])