Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
48f5ffaf
Commit
48f5ffaf
authored
May 14, 2018
by
J. Fernando Sánchez
Browse files
Defer plugin validation to init
parent
73f7cbbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
senpy/plugins/__init__.py
View file @
48f5ffaf
...
@@ -49,11 +49,11 @@ class PluginMeta(models.BaseMeta):
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment