[121367] branches/gsoc14-pip2port/pypi2port.py

gaurav at macports.org gaurav at macports.org
Tue Jun 24 00:27:15 PDT 2014


Revision: 121367
          https://trac.macports.org/changeset/121367
Author:   gaurav at macports.org
Date:     2014-06-24 00:27:14 -0700 (Tue, 24 Jun 2014)
Log Message:
-----------
Updated the regex for license and only printable characters to be included in description

Modified Paths:
--------------
    branches/gsoc14-pip2port/pypi2port.py

Modified: branches/gsoc14-pip2port/pypi2port.py
===================================================================
--- branches/gsoc14-pip2port/pypi2port.py	2014-06-24 07:10:40 UTC (rev 121366)
+++ branches/gsoc14-pip2port/pypi2port.py	2014-06-24 07:27:14 UTC (rev 121367)
@@ -223,7 +223,7 @@
             license = license.split('\n')[0]
             license = re.sub(r'[\[\]\{\}\;\:\$\t\"\'\`\=(--)]+', ' ', license)
             license = re.sub(r'\s(\s)+', ' ', license)
-            license = re.sub(r'([A-Z]*)([a-z]*)([\s]+v*)([0-9]\.*[0-9]*)',
+            license = re.sub(r'([A-Z]*)([a-z]*)([\s]*v*)([0-9]\.*[0-9]*)',
                              r'\1\2-\4', license)
             license = re.sub(r'v(-*)([0-9])', r'\1\2', license)
             file.write('license             {0}\n'.format(license))
@@ -247,6 +247,8 @@
             summary = re.sub(r'[\[\]\{\}\;\:\$\t\"\'\`\=(--)]+',
                              ' ', summary)
             summary = re.sub(r'\s(\s)+', ' ', summary)
+            summary = summary.encode('utf-8')
+            summary = filter(lambda x: x in string.printable, summary)
             sum_lines = textwrap.wrap(summary)
             file.write('description         ')
             for sum_line in sum_lines:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140624/1693b045/attachment.html>


More information about the macports-changes mailing list