00001 import urllib2
00002
00003 def execute(macro, args):
00004 if(args):
00005 path = "http://pr.willowgarage.com/pr-docs/ros-packages/" + args + "/html/"
00006 url = path + "wiki_header.html"
00007 else:
00008 return "ERROR in RosdocHeader. Usage: [[RosdocHeader(pkg_name)]]"
00009
00010
00011 try:
00012 usock = urllib2.urlopen(url)
00013 data = usock.read()
00014 usock.close()
00015 except:
00016 return 'Newly proposed, mistyped, or obsolete package. Could not find package "' + args + '" in rosdoc'
00017
00018 data = data.replace('href="', 'href="' + path)
00019
00020
00021 data = data + '<a class="http" href="' + path + 'index.html">auto-generated code documentation</a>'
00022 return data