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

[PATCH] Python mailer hook script for Windows

From: Prucha, Brett A <Brett.Prucha.BAH_at_scrb.navy.mil>
Date: 2004-12-14 16:35:21 CET

A simple patch for tools/hook-scripts/mailer/mailer.py

* If the subject line is longer than 200 characters truncate the subject
  and add ... to the end. Exchange server was not sending out the email
  because the subject line was too long.
* Removed UNIX specific Python commands and replaced them with ones that
  will work for Windows.

=========================================================================
22a23
> import StringIO
71a73,75
> if len(subject) > 200:
> tmp = StringIO.StringIO(subject)
> subject = tmp.read(197) + "..."
97,101c101,112
< pipe_ob = popen2.Popen3(cmd)
< self.write(pipe_ob.fromchild.read())
<
< # wait on the child so we don't end up with a billion zombies
< pipe_ob.wait()

---
>     tmp = ""
>     print cmd
>     for i in cmd:
>         if len(tmp) > 0:
>             tmp = tmp + " "
>         if re.search("[ ,\t]", i) == None:
>             tmp = tmp + i
>         else:
>             tmp = tmp + "\"" + i + "\""
>     print tmp
>     ps = os.popen2(tmp)
>     self.write(ps[1].read())
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 14 18:47:26 2004

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.