From 48f5ffafa18270b16539e992bbadcf3b5bf229f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Mon, 14 May 2018 11:38:02 +0200 Subject: [PATCH] Defer plugin validation to init --- senpy/plugins/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/senpy/plugins/__init__.py b/senpy/plugins/__init__.py index 621ae76..66b56be 100644 --- a/senpy/plugins/__init__.py +++ b/senpy/plugins/__init__.py @@ -49,11 +49,11 @@ class PluginMeta(models.BaseMeta): attrs['name'] = alias if 'description' not in attrs: doc = attrs.get('__doc__', None) - if not doc: - raise Exception(('Please, add a description or ' - 'documentation to class {}').format(name)) - attrs['description'] = doc - attrs['name'] = alias + if doc: + attrs['description'] = doc + else: + logger.warn(('Plugin {} does not have a description. ' + 'Please, add a short summary to help other developers').format(name)) cls = super(PluginMeta, mcs).__new__(mcs, name, bases, attrs) if alias in mcs._classes: