[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 4317 - trunk/tools/hook-scripts

From: Greg Stein <gstein_at_lyra.org>
Date: 2003-01-10 02:44:07 CET

On Fri, Jan 10, 2003 at 01:00:34AM +0100, Branko Cibej wrote:
> gstein@tigris.org wrote:
>
> >+# ------------------------------------------------------------------------
> >+# TODO
> >+#
> >+# * pipe output into a mail program (and avoid os.popen)
> >
>
> Wouldn't using the smtplib.SMTP class be best? Then the mailer.py script
> wouldn't depend on the availability of a particular (unix) mail program.

For efficiency? Nope. I'd have to write loops like this:

  smtp = MySMTPSubclass(...)
  while 1:
    chunk = pipe.read(CHUNK_SIZE)
    if not chunk:
      break
    smtp.write_DATA(chunk)

The subclass is needed cuz you can't send a DATA except as one big string. I
want to stream it. Even then, a bunch of escaping is needed during the
delivery of that string.

My plan was to pipe the output of the diff subprocess right into stdin of
the mailer subprocess. I can also arrange to do that for N diff processes
all going into one mailer. The problem is that Windows can't really support
the pipes, fork, and descriptor duplication that is necessary for that.

That said: if somebody wants to tweak the code to enable SMTP handling?
Fine. I'm just not too interested in it. And yes, that means the script
won't work on Windows until somebody *does* do that.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 10 02:42:58 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.