node.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 
00003 """
00004 usage: %(progname)s [args]
00005 """
00006 
00007 import nstart
00008 
00009 import os, sys, string, time, getopt, re
00010 from pyclearsilver.log import *
00011 
00012 import neo_cgi, neo_util, neo_cs
00013 
00014 from pyclearsilver import CSPage
00015 from pyclearsilver import odb
00016 
00017 import MBPage
00018 import db_webui
00019 
00020 import roslib
00021 import roslib.scriptutil
00022 
00023 import webutil
00024 import nodeutil
00025 
00026 
00027 
00028 class MyPage(MBPage.MBPage):
00029   def setup(self, hdf):
00030     pass
00031     
00032   def display(self, hdf):
00033     node = hdf.getValue("Query.node", "")
00034     hdf.setValue("CGI.cur.node", node)
00035     webutil.set_tabs(hdf, ["status", "nodes"])
00036     webutil.grabTopics(hdf, ["/topics"])
00037 
00038     node_data = nodeutil.node_info(node)
00039 
00040     webutil.hdf_array(hdf, sorted(node_data["subscriptions"]), "CGI.cur.subscriptions")
00041     webutil.hdf_array(hdf, sorted(node_data["publications"]), "CGI.cur.publications")
00042     webutil.hdf_array(hdf, sorted(node_data["services"]), "CGI.cur.services")
00043     
00044     if "error" in node_data:
00045       hdf.setValue("CGI.cur.error", node_data["error"])
00046     
00047 def run(context):
00048   return MyPage(context, pagename="node", nologin=False)
00049 
00050 def main():
00051   context = CSPage.Context()
00052   run(context).start()
00053 
00054 if __name__ == "__main__":
00055   main()


webui
Author(s): Scott Hassan/hassan@willowgarage.com
autogenerated on Wed Apr 23 2014 10:36:00