Anonymous committed a23204b

Add catalog subcommand to create a toolshelf catalog.

Comments (0)

Files changed (2)

 *   render Jinja2 templates with the data (one file per node) and
     dump all nodes to a single JSON file (`chrysoberyl render`)
 *   update the Atom news feed (`chrysoberyl announce`)
+*   create a `toolshelf` catalog of Bitbucket repos (`chrysoberyl catalog`)
 If mercurial repositories of the distributions are available locally, it
 can also:


 from chrysoberyl.feed import make_news_feed
 from chrysoberyl.loader import load_chrysoberyl_dir
 from chrysoberyl.localrepos import (
+    bitbucket_repos,
     troll_docs, survey_repos, get_latest_release_tag, lint_dists
 from chrysoberyl.renderer import Renderer
     do_it("hg archive -t zip -r %s %s %s" % (tag, excludes, full_filename))
+def catalog(args, optparser):
+    """Create a toolshelf catalog from distribution nodes.
+    """
+    options, args = optparser.parse_args(args)
+    data = load_and_check(options.data_dir)
+    for (key, user, repo) in bitbucket_repos(data):
+        print 'bb:%s/%s' % (user, repo)
 ### helpers ###
     'survey': survey,
     'lint': lint,
     'release': release,
+    'catalog': catalog,