Commit a0f5752e authored by Jason R. Coombs's avatar Jason R. Coombs

Extract another function for constructing linkified changes

--HG--
branch : distribute
extra : rebase_source : e764f523fff11bf7caa7e5183c7300afeee75dab
parent 878a81c6
...@@ -133,15 +133,18 @@ if _being_installed(): ...@@ -133,15 +133,18 @@ if _being_installed():
from distribute_setup import _before_install from distribute_setup import _before_install
_before_install() _before_install()
# return contents of reStructureText file with linked issue references
def _linkified(rst_path): def _linkified(rst_path):
bitroot = 'http://bitbucket.org/tarek/distribute' "return contents of reStructureText file with linked issue references"
revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I)
rst_file = open(rst_path) rst_file = open(rst_path)
rst_content = rst_file.read() rst_content = rst_file.read()
rst_file.close() 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 = revision.findall(rst_content) # ['Issue #43', ...]
anchors = sorted(set(anchors)) anchors = sorted(set(anchors))
rst_content = revision.sub(r'`\1`_', rst_content) rst_content = revision.sub(r'`\1`_', rst_content)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment