Plugin autogen list: handle variable-width plugin names
We've had a couple of cases where plugin names are longer than our
table width.
Take the fixed-with table-header out of the header file, and generate
it dynamically based on first-column width. To simplify, take
advantage that RST allows a variable-length last column and so don't
specify it's width.
Add a link to the cgit URL for each project you can click on to browse
the source (link text remains the git:// URL).
Add some logging so you can see what the python generator is doing,
should you run it.
Change-Id: I5d5e692039bbb30b2508119412472dac1d105c08
diff --git a/tools/generate-devstack-plugins-list.py b/tools/generate-devstack-plugins-list.py
index 1fa5501..aeec4dd 100644
--- a/tools/generate-devstack-plugins-list.py
+++ b/tools/generate-devstack-plugins-list.py
@@ -23,9 +23,12 @@
# working directory
# * network access to https://git.openstack.org/cgit
+import logging
import json
import requests
+logging.basicConfig(level=logging.DEBUG)
+
url = 'https://review.openstack.org/projects/'
# This is what a project looks like
@@ -37,6 +40,8 @@
'''
def is_in_openstack_namespace(proj):
+ # only interested in openstack namespace (e.g. not retired
+ # stackforge, etc)
return proj.startswith('openstack/')
# Rather than returning a 404 for a nonexistent file, cgit delivers a
@@ -50,10 +55,13 @@
else:
False
+logging.debug("Getting project list from %s" % url)
r = requests.get(url)
projects = sorted(filter(is_in_openstack_namespace, json.loads(r.text[4:])))
+logging.debug("Found %d projects" % len(projects))
found_plugins = filter(has_devstack_plugin, projects)
for project in found_plugins:
+ # strip of openstack/
print project[10:]