Relatorio

Bug 33

classification
Title: Warning emitted when loading plugins
Type: behavior Severity: minor
Components: core Versions:
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ced, lele
Priority: Keywords: patch

Created on 2017-08-09 13:08 by lele, last changed 2017-08-11 12:14 by ced.

Messages
msg37 Author: [hidden] (lele) Date: 2017-08-09 13:08
Currently relatorio tries to import four "plugins", and on
ImportError it emits a warning.

I never used the chart plugin, so I end up filtering out
that warning in almost every app that uses relatorio.

With the rationale that a user should know what she needs, I
think it should be better one of the following options:

a) remove the warning
b) replace the warnings.warn() with a logging.warn() (or
.debug() even)
c) separate the "needed" plugins from extension ones, do a
plain import on the former, and let the user explicitly
import additional ones as she need

I would go with c), if it were just for me... :)
msg38 Author: [hidden] (ced) Date: 2017-08-11 10:37
review44271002 has been submitted.
msg39 Author: [hidden] (ced) Date: 2017-08-11 10:39
I'm wondering if we should not just rework chart.py to be
importable even if pycha is not installed. And so just fail
when trying to use it or not add it to the factory.
msg40 Author: [hidden] (lele) Date: 2017-08-11 12:10
We could, but would be the advantage? What's the point of
(always) importing the (non-working) plugin and fail later,
when we can simply detect the missing dependency at import
time? Maybe backward compatibility?
msg41 Author: [hidden] (ced) Date: 2017-08-11 12:14
It will give a better separation of responsibility.
Each module is responsible to register itself to the factory
and it should always be like that. The engine should not
care about specific plugin may or may not fail to import.
History
Date User Action Args
2017-08-11 12:14:03cedsetmessages: + msg41
2017-08-11 12:10:09lelesetmessages: + msg40
2017-08-11 10:41:54cedsetkeywords: + patch
2017-08-11 10:39:29cedsetmessages: + msg39
2017-08-11 10:37:54cedsetnosy: + ced
messages: + msg38
2017-08-09 13:08:22lelecreate