Add macro for linking to codename pages based on a suite

This will further reduce the need for page edits after stable releases.
parent 1b080aaf
from MoinMoin import wikiutil
suites = set(['oldoldstable', 'oldstable', 'stable', 'testing', 'unstable', 'experimental'])
def execute(macro, suite):
if suite in suites:
with open('/srv/wiki.debian.org/var/apt/%s.codename' % suite, 'r') as codename_file:
codename = codename_file.read().strip().title()
pagename = 'Debian' + codename
return \
macro.formatter.pagelink(1, pagename) + \
macro.formatter.text(codename) + \
macro.formatter.pagelink(0, pagename)
return ''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment