[Lazarus] Help extending a python script

Luca Olivetti luca at wetron.es
Wed May 27 10:43:25 CEST 2009


En/na Vincent Snijders ha escrit:
> Hi,
> 
> I wondered if there are some python users on this list that can help us 
> to fix issue 13838: http://bugs.freepascal.org/view.php?id=13838
> 
> Basically the svn2feed.py script from 
> http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/svn2feed.py 
> needs to be extended, so that is limits the length of a line in the log 
> messageand wraps the rest to next line(s).
> 
> Patches are welcome. :-)

Try this (untested):

--- svn2feed.py.orig    2009-05-27 10:28:41.658689058 +0200
+++ svn2feed.py 2009-05-27 10:29:27.851320075 +0200
@@ -71,6 +71,7 @@
  # $LastChangedRevision$

  import sys
+import textwrap

  # Python 2.4 is required for subprocess
  if sys.version_info < (2, 4):
@@ -146,7 +147,7 @@
          changed_data = proc.stdout.readlines()

          desc = ("\nRevision: %s\nLog: %sModified: \n%s"
-                % (revision, info_lines[3], changed_data))
+                % (revision, textwrap.fill(info_lines[3],60), 
changed_data))

          item_dict = {
              'author': info_lines[0].strip('\n'),



Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 (Ext.133)  Fax +34 93 5883007




More information about the Lazarus mailing list