diff options
author | Fathi Boudra <fabo@debian.org> | 2012-03-12 19:32:57 +0200 |
---|---|---|
committer | Fathi Boudra <fabo@debian.org> | 2012-03-12 19:32:57 +0200 |
commit | 15f8347133ee4acb9f5acc343f9074617b6ba81f (patch) | |
tree | 39846c378e4bb173ac5f0b815769972c9f8a2498 | |
parent | 992e3ae38e0286128dd62fe10c0443ddd272b75c (diff) |
Add initial script to get blueprints
-rwxr-xr-x | tools/launchpad/get-blueprints.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/launchpad/get-blueprints.py b/tools/launchpad/get-blueprints.py new file mode 100755 index 0000000..411b771 --- /dev/null +++ b/tools/launchpad/get-blueprints.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python2.7 + +import os +import sys +import re +#import argparse + +import launchpadlib +from launchpadlib.launchpad import Launchpad + +if __name__ == '__main__': + CACHE_DIR = os.path.expanduser('~/.launchpadlib/cache') + + lp = Launchpad.login_anonymously( + 'linaro project management', + 'production', + version='devel') + + pillar = lp.projects["lava"] + project_blueprints = pillar.valid_specifications + for blueprint in project_blueprints: + milestone = blueprint.milestone + if milestone is not None and milestone.name == '2012.03': + print "%s" % (blueprint) + whiteboard = blueprint.whiteboard +# print "%s" % (whiteboard) + + headlinePattern = re.compile('^Headline: (?P<headline>.*)$', re.IGNORECASE | re.MULTILINE) + headline = headlinePattern.findall(whiteboard) + + acceptancePattern = re.compile('^Acceptance: (?P<acceptance>.*)$', re.IGNORECASE | re.MULTILINE) + acceptance = acceptancePattern.findall(whiteboard) + + for headlineMatch in headline: + print "Headline: %s" % headlineMatch + + for acceptanceMatch in acceptance: + print "Acceptance: %s\n" % acceptanceMatch + + print "\n" |