[120941] branches/gsoc14-pip2port/tester.py
gaurav at macports.org
gaurav at macports.org
Thu Jun 12 01:59:04 PDT 2014
Revision: 120941
https://trac.macports.org/changeset/120941
Author: gaurav at macports.org
Date: 2014-06-12 01:59:03 -0700 (Thu, 12 Jun 2014)
Log Message:
-----------
Text-wraping in short-description of the port
Modified Paths:
--------------
branches/gsoc14-pip2port/tester.py
Modified: branches/gsoc14-pip2port/tester.py
===================================================================
--- branches/gsoc14-pip2port/tester.py 2014-06-12 07:34:40 UTC (rev 120940)
+++ branches/gsoc14-pip2port/tester.py 2014-06-12 08:59:03 UTC (rev 120941)
@@ -231,7 +231,7 @@
license = license.encode('utf-8')
file.write('license '+license+'\n')
else:
- file.write('license \n')
+ file.write('license None\n')
if dict['maintainer']:
file.write('maintainers ' + ' '.join(dict['maintainer']) + '\n\n')
@@ -239,18 +239,26 @@
file.write('maintainers nomaintainer\n\n')
summary = dict['summary']
- summary = re.sub(r'[\[\]\{\}\;\:\$\t\"\'\`]',' ',summary)
+ if summary:
+ summary = re.sub(r'[\[\]\{\}\;\:\$\t\"\'\`]',' ',summary)
+ sum_lines = textwrap.wrap(summary,width=70)
+ file.write('description ')
+ for sum_line in sum_lines:
+ if sum_line:
+ if not sum_lines.index(sum_line)==0:
+ file.write(' ')
+ if sum_line == sum_lines[-1]:
+ file.write(sum_line+"\n")
+ else:
+ file.write(sum_line + " \\\n")
+ else:
+ file.write('description None\n\n')
# file.write('description '+dict['summary']+'\n\n')
- file.write('description '+summary+'\n\n')
+# file.write('description '+summary+'\n\n')
# file.write('long_description '+dict['description']+'\n\n')
description = dict['description']
if description:
description = description.encode('utf-8')
-# description = string.replace(description,';',' ')
-# description = string.replace(description,'[',' ')
-# description = string.replace(description,']',' ')
-# description = string.replace(description,'{',' ')
-# description = string.replace(description,'}',' ')
description = re.sub(r'[\[\]\{\}\;\:\$\t\"\'\`]',' ',description)
# lines = textwrap.wrap(dict['description'],width=70)
lines = textwrap.wrap(description,width=70)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140612/1dc9ef10/attachment.html>
More information about the macports-changes
mailing list