Plugin base classes: update method signatures & fix raise (#598)

This way IDEs can verify method overrides in subclasses, otherwise these
are flagged as erroneous.

Changed base classes to properly raise NotImplementedError; previously
they would cause "TypeError: exceptions must derive from BaseException"

Also fixed exception handling in sources.service.clean().
This commit is contained in:
Marti Raudsepp
2016-12-14 23:42:29 +02:00
committed by kevgliss
parent 1eb3d563c6
commit b327963925
7 changed files with 20 additions and 20 deletions

View File

@ -198,7 +198,7 @@ def clean(source):
try:
certificates = s.clean(source.options)
except NotImplemented:
except NotImplementedError:
current_app.logger.warning("Cannot clean source: {0}, source plugin does not implement 'clean()'".format(
source.label
))