You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Prucha, Brett A" <Br...@scrb.navy.mil> on 2004/12/14 15:35:21 UTC

[PATCH] Python mailer hook script for Windows

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


Re: [PATCH] Python mailer hook script for Windows

Posted by Max Bowsher <ma...@ukf.net>.
Prucha, Brett A wrote:
> 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) + "..."

Please resend as a unified-context diff ("diff -u"). Contextless diffs are 
unusable without specification of the *exact* version on which they are 
based, and also make it far harder to review the patch in email.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org