topic.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 class MyPage(MBPage.MBPage):
00027   def setup(self, hdf):
00028     pass
00029     
00030   def display(self, hdf):
00031     topic = hdf.getValue("Query.topic", "")
00032     hdf.setValue("CGI.cur.topic", topic)
00033     webutil.set_tabs(hdf, ["status", "topics"])
00034     webutil.grabTopics(hdf, ["/topics", topic, "/battery_state", "/power_board_state", "/app_status"])
00035 
00036     topic_data = nodeutil.topic_info(topic)
00037 
00038     if "error" in topic_data:
00039       hdf.setValue("CGI.cur.error", topic_data["error"])
00040     else:
00041       webutil.hdf_array(hdf, sorted(topic_data["publishers"]), "CGI.cur.publishers")
00042       webutil.hdf_array(hdf, sorted(topic_data["subscribers"]), "CGI.cur.subscribers")
00043 
00044 def run(context):
00045   return MyPage(context, pagename="topic", nologin=False)
00046 
00047 def main():
00048   context = CSPage.Context()
00049   run(context).start()
00050 
00051 if __name__ == "__main__":
00052   main()


webui
Author(s): Scott Hassan/hassan@willowgarage.com
autogenerated on Sat Dec 28 2013 17:47:58