diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-05 09:08:11 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-05 09:08:11 -0400 |
commit | a0f5752e58db3a0eaaa68b22f0b1f878e824a117 (patch) | |
tree | 04b03cf95791b52b11ea81b572d78b8c9348da8c /setup.py | |
parent | 878a81c62061ab506ed1874d541cbeb714fe06fe (diff) | |
download | external_python_setuptools-a0f5752e58db3a0eaaa68b22f0b1f878e824a117.tar.gz external_python_setuptools-a0f5752e58db3a0eaaa68b22f0b1f878e824a117.tar.bz2 external_python_setuptools-a0f5752e58db3a0eaaa68b22f0b1f878e824a117.zip |
Extract another function for constructing linkified changes
--HG--
branch : distribute
extra : rebase_source : e764f523fff11bf7caa7e5183c7300afeee75dab
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -133,15 +133,18 @@ if _being_installed(): from distribute_setup import _before_install _before_install() -# return contents of reStructureText file with linked issue references def _linkified(rst_path): - bitroot = 'http://bitbucket.org/tarek/distribute' - revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) - + "return contents of reStructureText file with linked issue references" rst_file = open(rst_path) rst_content = rst_file.read() rst_file.close() + return _linkified_text(rst_content) + +def _linkified_text(rst_content): + bitroot = 'http://bitbucket.org/tarek/distribute' + revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) + anchors = revision.findall(rst_content) # ['Issue #43', ...] anchors = sorted(set(anchors)) rst_content = revision.sub(r'`\1`_', rst_content) |