[Zope-dev] zope.sendmail Retry fixes and new state machine.

Gary Poster gary at zope.com
Tue Mar 11 17:26:26 EDT 2008


On Mar 11, 2008, at 5:01 PM, Matthew Grant wrote:

> Hi!
>
>
> On Sun, 2008-03-09 at 20:54 -0400, Gary Poster wrote:
>> I did have one somewhat trivial thought.  I generally prefer  
>> durations
>> and intervals expressed as datetime.timedeltas myself, because they
>> convey their meaning without having to look it up docs (is that  
>> number
>> value a number of seconds?  milliseconds?  minutes?).  There might
>> even be a zcml built in for schema field for that; I believe I
>> remember that there is in ZConfig.
>
> Minor detail - yes it has warts - there are other things that will  
> need
> doing to, its just time that this code was put out there.

Completely agree.

>> Also, some variety of doctest would be nice.  Even when a package is
>> not using doctests, I add new tests as doctest unless there's a  
>> really
>> good reason not to.
>
> It was the only way I could debug and introspect the problems from the
> Unit tests - the python debugger does not run properly from the
> doctests, and the original test are all unit tests...

Understood.

For future reference, if you out the set_trace on the same line, you  
*can* use pdb.  For instance, this would let you walk into the  
``do_foo`` function.

     >>> import pdb; pdb.set_trace(); do_foo()

>> In this case, it looks like you've made the code significantly more
>> robust, which has added some probably necessary complexity.  The code
>> looks readable, but I recommend a maintainer-oriented overview/
>> introduction as a doctest, at the least.  For instance, perhaps you
>> could think about documentation about the rationale for the approach
>> and about the dance that this code participates in (with the lock
>> files and all the possible SMTP error conditions and the code's
>> responses).  Of course, even more friendly docs than that would be
>> nice, but I'm only asking for what I myself tend to give,  
>> unfortunately.
>
> A little does need adding there - I have scanned state machine  
> diagrams
> and the design rationale.  I will go and put those in the checkin  
> when I
> have a spare moment.

Sounds like a great start.

Thanks for your work.

Gary



More information about the Zope-Dev mailing list