Mercurial > libervia-backend
comparison src/core/sat_main.py @ 2525:e8e1507049b7
core: use C.bool to detect value of "handler" field in PLUGIN_INFO
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 16 Mar 2018 17:00:57 +0100 |
parents | d485e9416493 |
children | 7da86e1633a5 |
comparison
equal
deleted
inserted
replaced
2524:e96076cdf74c | 2525:e8e1507049b7 |
---|---|
267 log.warning(u'Error while loading plugin "{name}", ignoring it: {error}' | 267 log.warning(u'Error while loading plugin "{name}", ignoring it: {error}' |
268 .format(name=plugin_info['name'], error=e)) | 268 .format(name=plugin_info['name'], error=e)) |
269 if optional: | 269 if optional: |
270 return | 270 return |
271 raise ImportError(u"Error during initiation") | 271 raise ImportError(u"Error during initiation") |
272 if 'handler' in plugin_info and plugin_info['handler'] == 'yes': | 272 if C.bool(plugin_info.get(C.PI_HANDLER, C.BOOL_FALSE)): |
273 self.plugins[import_name].is_handler = True | 273 self.plugins[import_name].is_handler = True |
274 else: | 274 else: |
275 self.plugins[import_name].is_handler = False | 275 self.plugins[import_name].is_handler = False |
276 # we keep metadata as a Class attribute | 276 # we keep metadata as a Class attribute |
277 self.plugins[import_name]._info = plugin_info | 277 self.plugins[import_name]._info = plugin_info |