Reputation: 811
I've decided to improve the quality of my code by running some known working code through pylint
. In particular I have a milter using pymilter
. Here is the really simple code that I'm running:
#!/usr/bin/python3
"Test Milter"
import Milter
# Configuration
# List of email addresses for which incoming mail should be rejected:
EMAILS = ('[email protected]', '[email protected]')
# Socket for milter
SOCKETNAME = 'inet:[email protected]'
# End of Configuration
class TestMilter(Milter.Milter):
"Test Milter"
def __init__(self):
self.milter_id = Milter.uniqueID()
def envrcpt(self, to, *str):
"Reject mail if the To: address is one of the specified e-mail addresses."
if any(e in to for e in EMAILS):
return Milter.REJECT
return Milter.ACCEPT
if __name__ == "__main__":
Milter.factory = TestMilter
Milter.runmilter("test_milter", SOCKETNAME, 240)
Here is the output of pylint -E
:
************* Module test_milter
test_milter.py:24:19: E1101: Module 'Milter' has no 'REJECT' member (no-member)
test_milter.py:25:15: E1101: Module 'Milter' has no 'ACCEPT' member (no-member)
I've looked high and low, and simply do not understand why pylint
is giving me this output. I don't want to tell it to ignore this particular rule, because it is actually a very useful rule most of the time. Any ideas?
Upvotes: 0
Views: 135