Codebase list oslo-sphinx / 7de9722
Correct project source guessing for OpenStack The links to the project source in all the developer docs are incorrect. The link for keystone is like http://git.openstack.org/cgit/p/openstack/keystone when it should be http://git.openstack.org/cgit/openstack/keystone See the link to "Project Source" on the left on http://docs.openstack.org/developer/keystone/ for example. Also, developers sometimes use a ".git" URL when they clone so strip off the .git. Change-Id: I8e7620119a169e3322d602ea633303cf9f941605 Brant Knudson 8 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1212 # under the License.
1313
1414 import os
15 import re
1516 import six
1617 from six.moves.urllib import parse
1718 import subprocess
3233 if six.PY3:
3334 git_remote = os.fsdecode(git_remote)
3435 parsed = parse.urlparse(git_remote)
35 return CGIT_BASE + parsed.path.lstrip('/')
36 parsed = '/'.join(parsed.path.rstrip('/').split('/')[-2:])
37 parsed = re.sub(r'\.git$', '', parsed)
38 return CGIT_BASE + parsed
3639
3740
3841 def _html_page_context(app, pagename, templatename, context, doctree):