mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 00:02:28 +00:00
Defer plugin validation to init
This commit is contained in:
parent
73f7cbbe8a
commit
48f5ffafa1
@ -49,11 +49,11 @@ class PluginMeta(models.BaseMeta):
|
|||||||
attrs['name'] = alias
|
attrs['name'] = alias
|
||||||
if 'description' not in attrs:
|
if 'description' not in attrs:
|
||||||
doc = attrs.get('__doc__', None)
|
doc = attrs.get('__doc__', None)
|
||||||
if not doc:
|
if doc:
|
||||||
raise Exception(('Please, add a description or '
|
attrs['description'] = doc
|
||||||
'documentation to class {}').format(name))
|
else:
|
||||||
attrs['description'] = doc
|
logger.warn(('Plugin {} does not have a description. '
|
||||||
attrs['name'] = alias
|
'Please, add a short summary to help other developers').format(name))
|
||||||
cls = super(PluginMeta, mcs).__new__(mcs, name, bases, attrs)
|
cls = super(PluginMeta, mcs).__new__(mcs, name, bases, attrs)
|
||||||
|
|
||||||
if alias in mcs._classes:
|
if alias in mcs._classes:
|
||||||
|
Loading…
Reference in New Issue
Block a user