Skip to content

Instantly share code, notes, and snippets.

@wbsch
Created July 22, 2015 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbsch/e529c0d136b179e9c536 to your computer and use it in GitHub Desktop.
Save wbsch/e529c0d136b179e9c536 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Proof of Concept for expanding aliases in annotations.
#
# See https://bug.tasktools.org/browse/TW-77
import json
import re
import sys
old = json.loads(sys.stdin.readline())
new = json.loads(sys.stdin.readline())
if "annotations" in new:
for anno in new["annotations"]:
anno["description"] = re.sub(r"dbugs:([^ ]+)", r"http://bugs.debian.org/\1", anno["description"])
print(json.dumps(new))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment