aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--export.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/export.py b/export.py
index 0e69803..c3d9625 100644
--- a/export.py
+++ b/export.py
@@ -76,10 +76,19 @@ def extract_languages(tags):
return list(set(langs))
+def catechise(s):
+ heresies = ["open source", "debian", "(?<!gnu/)linux", "creative commons"]
+ pattern = '\\b(%s)\\b' % '|'.join([h.replace(' ', '.') for h in heresies])
+ return re.sub(pattern,
+ lambda m: '??%s??' % m.group(1).replace('\n', ' '),
+ s,
+ re.DOTALL | re.IGNORECASE)
+
def munge_description(s):
paras = s.split('\n .\n')
return '\n\n'.join(
- textwrap.fill(para.lstrip().replace('\n', ''), 65) for para in paras)
+ catechise(textwrap.fill(para.lstrip().replace('\n', ''), 65))
+ for para in paras)
def get_license_map():
map = {}