From 8caf726438959cb7cf3c609023bd0ccd49b0bcda Mon Sep 17 00:00:00 2001 From: John Chilton <jmchilton@gmail.com> Date: Mon, 20 Apr 2015 16:42:16 -0400 Subject: [PATCH] Update history, bring in planemo's script to help with that. --- HISTORY.rst | 12 +++++++++++- bootstrap_history.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 bootstrap_history.py diff --git a/HISTORY.rst b/HISTORY.rst index 1f9faf7b..97a5a5e2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,11 +3,15 @@ History ------- +.. to_doc + ------------------------ 0.4.0.dev0 ------------------------ -* Python 3 support. +* Python 3 support. `Pull Request 62`_ +* Fix bug encountered when running ``pulsar-main`` and ``pulsar-config`` commands as scripts. 9d43ae0_ +* Add ``pulsar-run`` script for issues commands against a Pulsar server (experimental). 3cc7f74_ ------------------------ 0.3.0 (2015-04-12) @@ -48,3 +52,9 @@ History * See the original `announcement <http://dev.list.galaxyproject.org/New-Remote-Job-Runner-td4138951.html>`__ and `initial commit <https://github.com/galaxyproject/pulsar/commit/163ed48d5a1902ceb84c38f10db8cbe5a0c1039d>`__. + + +.. github_links +.. _3cc7f74: https://github.com/galaxyproject/pulsar/commit/3cc7f74 +.. _9d43ae0: https://github.com/galaxyproject/pulsar/commit/9d43ae0 +.. _Pull Request 62: https://github.com/galaxyproject/pulsar/pull/62 diff --git a/bootstrap_history.py b/bootstrap_history.py new file mode 100644 index 00000000..186e111c --- /dev/null +++ b/bootstrap_history.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# Little script to make HISTORY.rst more easy to format properly, lots TODO +# pull message down and embed, use arg parse, handle multiple, etc... +import os +import sys + + +PROJECT_DIRECTORY = os.path.join(os.path.dirname(__file__)) +PROJECT_URL="https://github.com/galaxyproject/pulsar" + +def main(argv): + history_path = os.path.join(PROJECT_DIRECTORY, "HISTORY.rst") + history = open(history_path, "r").read() + + def extend(from_str, line): + from_str += "\n" + return history.replace(from_str, from_str + line + "\n" ) + + ident = argv[1] + if ident.startswith("pr"): + pull_request = ident[len("pr"):] + text = ".. _Pull Request {0}: {1}/pull/{0}".format(pull_request, PROJECT_URL) + history = extend(".. github_links", text) + history = extend(".. to_doc", "`Pull Request {0}`_".format(pull_request)) + elif ident.startswith("issue"): + issue = ident[len("issue"):] + text = ".. _Issue {0}: {1}/issues/{0}".format(issue, PROJECT_URL) + history = extend(".. github_links", text) + history = extend(".. to_doc", "`Issue {0}`_".format(issue)) + else: + short_rev = ident[:7] + text = ".. _{0}: {1}/commit/{0}".format(short_rev, PROJECT_URL) + history = extend(".. github_links", text) + history = extend(".. to_doc", "{0}_".format(short_rev)) + open(history_path, "w").write(history) + +if __name__ == "__main__": + main(sys.argv) -- GitLab