Commits

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:

src/chrysoberyl/commands.py

 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))
     os.chdir(cwd)
 
+
+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,
 }
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.