Discussion:
[Erp5-dev] Useless Imports in ERP5
Rafael Monnerat
2007-10-17 16:11:32 UTC
Permalink
I was testing a little bit the pyflakes (nice tool), I saw that there is
many non used imports at Documents Like Contraints , Interfaces,
GetToolByName ... I removed in some files but I don't know if should be
kept for another reason or is right remove it.

What should be done with these imports?
Jérome Perrin
2007-10-23 11:46:25 UTC
Permalink
Post by Rafael Monnerat
I was testing a little bit the pyflakes (nice tool), I saw that there is
many non used imports at Documents Like Contraints , Interfaces,
GetToolByName ... I removed in some files but I don't know if should be
kept for another reason or is right remove it.
What should be done with these imports?
Removing unused import will take ages, for now what's important is that
we don't add more. If you want to remove some, go ahead, but make sure
that they are really unused, sometimes importing a module have sides
effects.
Actually undefined names are the real problem, there are still some in
ERP5 products and business templates.
BTW, we have a tool to run pyflakes on python scripts inside business
templates, it's called erp5flakes and it's on pypi.

J?rome
Rafael Monnerat
2007-10-23 13:16:23 UTC
Permalink
Hi Jerome
Post by Jérome Perrin
Post by Rafael Monnerat
I was testing a little bit the pyflakes (nice tool), I saw that there is
many non used imports at Documents Like Contraints , Interfaces,
GetToolByName ... I removed in some files but I don't know if should be
kept for another reason or is right remove it.
What should be done with these imports?
Removing unused import will take ages, for now what's important is that
we don't add more. If you want to remove some, go ahead, but make sure
that they are really unused, sometimes importing a module have sides
effects.
Actually undefined names are the real problem, there are still some in
ERP5 products and business templates.
BTW, we have a tool to run pyflakes on python scripts inside business
templates, it's called erp5flakes and it's on pypi.
I started to erp5flakes (I download from erp5 svn) and it's quite nice.
This tool should be integrated at erp5_forge, save a lot of time of
devolopment.
Post by Jérome Perrin
J?rome
Rafael

Loading...