# Debian BTS macro for Trac
# Usage: [[Debbug(nnnnn)]]
#        [[Debbug(package)]]
#        [[Debug]]

def execute(hdf, txt, env):
    args = txt or ""
    if args.isdigit(): text = "Debian bug #%s" % args
    elif args: text = "Debian bugs for %s" % args
    else: text = "Debian Bug Tracking System"
    return """<a href="http://bugs.debian.org/%s">%s</a>""" % (args, text)

