Fix candidate name's space

Change-Id: Iea4f6feb0af64e078c37e8c957ca7c0ea4b8adef
This commit is contained in:
Tristan Cacqueray 2015-09-10 21:14:41 -04:00
parent a5695b2027
commit 3f3a30a819
3 changed files with 6 additions and 5 deletions

View File

@ -1,10 +1,10 @@
{{ election.capitalize() }} PTL Candidates {{ election.capitalize() }} PTL Candidates
====================== ======================
{% for project in projects %}{% if project != 'TC' %} {% for project in projects %}{% if project != 'TC' %}
* `{{ project }} <http://git.openstack.org/cgit/openstack/election/plain/candidates/{{ election }}/{{ project }}>`_ * `{{ project.replace('_', ' ') }} <http://git.openstack.org/cgit/openstack/election/plain/candidates/{{ election }}/{{ project }}>`_
{% for candidate in candidates[project] %} {% for candidate in candidates[project] %}
* `{{ candidate.split('/')[-1][:-4] }} <http://git.openstack.org/cgit/openstack/election/plain/{{ candidate }}>`_ * `{{ candidate.split('/')[-1][:-4].replace('_', ' ') }} <http://git.openstack.org/cgit/openstack/election/plain/{{ candidate }}>`_
{% endfor %} {% endfor %}
{% endif %}{% endfor %} {% endif %}{% endfor %}

View File

@ -2,5 +2,5 @@
====================== ======================
{% for candidate in candidates['TC'] %} {% for candidate in candidates['TC'] %}
* `{{ candidate.split('/')[-1][:-4] }} <http://git.openstack.org/cgit/openstack/election/plain/{{ candidate }}>`_ * `{{ candidate.split('/')[-1][:-4].replace('_', ' ') }} <http://git.openstack.org/cgit/openstack/election/plain/{{ candidate }}>`_
{% endfor %} {% endfor %}

View File

@ -19,11 +19,12 @@ def main(argv):
candidates_list['projects'] = ['TC'] candidates_list['projects'] = ['TC']
for project in candidates_list['projects']: for project in candidates_list['projects']:
print "* %s" % project print "* %s" % project.replace('_', ' ')
for candidate in candidates_list['candidates'][project]: for candidate in candidates_list['candidates'][project]:
candidate_name = candidate.split('/')[-1][:-4].replace('_', ' ')
print "** [%s/%s %s]" % (GIT_BASE, print "** [%s/%s %s]" % (GIT_BASE,
candidate.replace(' ', '%20'), candidate.replace(' ', '%20'),
candidate.split('/')[-1][:-4]) candidate_name)
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv) main(sys.argv)