Launchpad Bug Macro for the Wiki

Leo Iannacone leo.iannacone at gmail.com
Wed May 28 07:34:47 UTC 2008


2008/5/28 Matthew East <mdke at ubuntu.com>:
> We don't have access to the wiki, but it's a clever idea and if you've
> tested the macro and it works then definitely propose it to the
> sysadmins.

Hi,
I've tested the code of first mail, but it has some problem.

This could be right (works!  ;)  ) (I've added a test on arg to get
more security to the macro)


Dependencies = []
def execute(macro, arg):
    ## Test if arg is an integer (against malicious arg, for example
bad html passed as argument)
    try:
	bug = int(arg)
    ## If it isn't (it's not a integer), user cannot save page
    except:
	raise Exception ("ExceptionArgValue: The argument \"%s\" is invalid.
Please insert a integer as macro argument." % arg)

    launchpad = "http://bugs.launchpad.net/bugs/"
    return ("<a href=%s%s>Bug #%s</a>" % (launchpad, bug, bug) )


Leo.

-- 
GPG Key ID: D59257A9
Jabber ID: l3on at jabber.linux.it
Administrator of Ubuntu Italian Wiki
More info: http://wiki.ubuntu.com/LeoIannacone




More information about the ubuntu-doc mailing list