|
From: <wgh...@us...> - 2009-08-27 05:37:41
|
Revision: 23108
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=23108&view=rev
Author: wghassan
Date: 2009-08-27 05:37:29 +0000 (Thu, 27 Aug 2009)
Log Message:
-----------
added support to applications
Modified Paths:
--------------
pkg/trunk/sandbox/web/launchman/msg/AppStatus.msg
pkg/trunk/sandbox/web/launchman/src/launchman.py
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/db_webui.py
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros.js
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros_toolbar.js
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/apps.cs
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/header.cs
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/includes.cs
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/status.cs
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/style_desktop.css
pkg/trunk/sandbox/web/webui/src/webui/startcgi.py
pkg/trunk/sandbox/web/webui/src/webui/startmod.py
Added Paths:
-----------
pkg/trunk/sandbox/web/launchman/msg/Application.msg
pkg/trunk/sandbox/web/sample_application/
pkg/trunk/sandbox/web/sample_application/README
pkg/trunk/sandbox/web/sample_application/cgibin/
pkg/trunk/sandbox/web/sample_application/cgibin/__init__.py
pkg/trunk/sandbox/web/sample_application/cgibin/sample_application_index.py
pkg/trunk/sandbox/web/sample_application/images/
pkg/trunk/sandbox/web/sample_application/images/screenshot.png
pkg/trunk/sandbox/web/sample_application/jslib/
pkg/trunk/sandbox/web/sample_application/listener
pkg/trunk/sandbox/web/sample_application/listener.py
pkg/trunk/sandbox/web/sample_application/manifest.xml
pkg/trunk/sandbox/web/sample_application/sample_app.app
pkg/trunk/sandbox/web/sample_application/talker
pkg/trunk/sandbox/web/sample_application/talker.py
pkg/trunk/sandbox/web/sample_application/talker_listener.launch
pkg/trunk/sandbox/web/sample_application/templates/
pkg/trunk/sandbox/web/sample_application/templates/index.cs
pkg/trunk/sandbox/web/webui/src/webui/cgistarter.py
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/appcon.py
Removed Paths:
-------------
pkg/trunk/sandbox/web/webui/src/webui/mod/webui/install_app.py
Modified: pkg/trunk/sandbox/web/launchman/msg/AppStatus.msg
===================================================================
--- pkg/trunk/sandbox/web/launchman/msg/AppStatus.msg 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/launchman/msg/AppStatus.msg 2009-08-27 05:37:29 UTC (rev 23108)
@@ -1 +1 @@
-string[] active
+Application[] active
Added: pkg/trunk/sandbox/web/launchman/msg/Application.msg
===================================================================
--- pkg/trunk/sandbox/web/launchman/msg/Application.msg (rev 0)
+++ pkg/trunk/sandbox/web/launchman/msg/Application.msg 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,3 @@
+string taskid
+string name
+string status
Modified: pkg/trunk/sandbox/web/launchman/src/launchman.py
===================================================================
--- pkg/trunk/sandbox/web/launchman/src/launchman.py 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/launchman/src/launchman.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -127,12 +127,14 @@
self._apps = {}
def _send_status(self):
- apps = self._apps.keys()
- self.app_status.publish(AppStatus(apps))
+ apps = []
+ for taskid, runner in self._apps.items():
+ apps.append(Application(taskid, runner.app.name, runner.task.status))
+ self.app_status.publish(apps)
def start_task(self, req):
a = app.App(req.taskid)
- a.load_yaml()
+ a.load()
pgroup = None
runner = self._taskGroups.get(a.provides, None)
Added: pkg/trunk/sandbox/web/sample_application/README
===================================================================
--- pkg/trunk/sandbox/web/sample_application/README (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/README 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,3 @@
+This is the simplest rospy demo: a talker node that publishes
+std_msgs/String to the /chatter topic and a listener node that subscribes
+to these messages.
Added: pkg/trunk/sandbox/web/sample_application/cgibin/sample_application_index.py
===================================================================
--- pkg/trunk/sandbox/web/sample_application/cgibin/sample_application_index.py (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/cgibin/sample_application_index.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,30 @@
+#! /usr/bin/env python
+
+"""
+usage: %(progname)s [args]
+"""
+
+import os, sys, string, time, getopt, re
+import neo_cgi, neo_util, neo_cs
+from pyclearsilver.log import *
+from pyclearsilver import CSPage, odb
+
+from webui import MBPage
+
+class MyPage(MBPage.MBPage):
+ def setup(self, hdf):
+ pass
+
+ def display(self, hdf):
+ pass
+
+
+def run(context):
+ return MyPage(context, pagename="index", nologin=1)
+
+def main():
+ context = CSPage.Context()
+ run(context).start()
+
+if __name__ == "__main__":
+ main()
Property changes on: pkg/trunk/sandbox/web/sample_application/cgibin/sample_application_index.py
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/trunk/sandbox/web/sample_application/images/screenshot.png
===================================================================
(Binary files differ)
Property changes on: pkg/trunk/sandbox/web/sample_application/images/screenshot.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: pkg/trunk/sandbox/web/sample_application/listener
===================================================================
--- pkg/trunk/sandbox/web/sample_application/listener (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/listener 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1 @@
+link listener.py
\ No newline at end of file
Property changes on: pkg/trunk/sandbox/web/sample_application/listener
___________________________________________________________________
Added: svn:special
+ *
Added: pkg/trunk/sandbox/web/sample_application/listener.py
===================================================================
--- pkg/trunk/sandbox/web/sample_application/listener.py (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/listener.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Willow Garage, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# Revision $Id: listener.py 5263 2009-07-17 23:30:38Z sfkwc $
+
+## Simple talker demo that listens to std_msgs/Strings published
+## to the 'chatter' topic
+
+PKG = 'rospy_tutorials' # this package name
+import roslib; roslib.load_manifest(PKG)
+
+import rospy
+from std_msgs.msg import String
+
+def callback(data):
+ rospy.loginfo(rospy.get_caller_id()+"I heard %s",data.data)
+
+def listener():
+
+ # in ROS, nodes are unique named. If two nodes with the same
+ # node are launched, the previous one is kicked off. The
+ # anonymous=True flag means that rospy will choose a unique
+ # name for our 'talker' node so that multiple talkers can
+ # run simultaenously.
+ rospy.init_node('listener', anonymous=True)
+
+ rospy.Subscriber("chatter", String, callback)
+
+ # spin() simply keeps python from exiting until this node is stopped
+ rospy.spin()
+
+if __name__ == '__main__':
+ listener()
Property changes on: pkg/trunk/sandbox/web/sample_application/listener.py
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/trunk/sandbox/web/sample_application/manifest.xml
===================================================================
--- pkg/trunk/sandbox/web/sample_application/manifest.xml (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/manifest.xml 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,14 @@
+<package>
+ <description brief="sample_app">
+ Sample Application
+ </description>
+ <author>Scott Hassan</author>
+ <license>BSD</license>
+ <review status="unreviewed" notes=""/>
+ <url>http://pr.willowgarage.com/wiki/sample_app</url>
+ <depend package="roslib"/>
+ <depend package="rospy"/>
+ <depend package="webui"/>
+</package>
+
+
Added: pkg/trunk/sandbox/web/sample_application/sample_app.app
===================================================================
--- pkg/trunk/sandbox/web/sample_application/sample_app.app (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/sample_app.app 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,7 @@
+name: Sample App
+package: sample_application
+launch_file: talker_listener.launch
+description: A sample ROS app to show the structure of an complete application. It shows how to build a webui and register a plugin.
+icon: images/screenshot.png
+provides:
+depends:
Added: pkg/trunk/sandbox/web/sample_application/talker
===================================================================
--- pkg/trunk/sandbox/web/sample_application/talker (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/talker 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1 @@
+link talker.py
\ No newline at end of file
Property changes on: pkg/trunk/sandbox/web/sample_application/talker
___________________________________________________________________
Added: svn:special
+ *
Added: pkg/trunk/sandbox/web/sample_application/talker.py
===================================================================
--- pkg/trunk/sandbox/web/sample_application/talker.py (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/talker.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Willow Garage, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# Revision $Id: talker.py 5263 2009-07-17 23:30:38Z sfkwc $
+
+## Simple talker demo that published std_msgs/Strings messages
+## to the 'chatter' topic
+
+import roslib; roslib.load_manifest('rospy_tutorials')
+
+import rospy
+from std_msgs.msg import String
+
+def talker():
+ pub = rospy.Publisher('chatter', String)
+ rospy.init_node('talker', anonymous=True)
+ r = rospy.Rate(1) # 10hz
+ while not rospy.is_shutdown():
+ str = "hello world %s"%rospy.get_time()
+ rospy.loginfo(str)
+ pub.publish(str)
+ r.sleep()
+
+if __name__ == '__main__':
+ try:
+ talker()
+ except rospy.ROSInterruptException: pass
Property changes on: pkg/trunk/sandbox/web/sample_application/talker.py
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/trunk/sandbox/web/sample_application/talker_listener.launch
===================================================================
--- pkg/trunk/sandbox/web/sample_application/talker_listener.launch (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/talker_listener.launch 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,4 @@
+<launch>
+ <node pkg="sample_application" type="listener.py"/>
+ <node pkg="sample_application" type="talker.py"/>
+</launch>
Added: pkg/trunk/sandbox/web/sample_application/templates/index.cs
===================================================================
--- pkg/trunk/sandbox/web/sample_application/templates/index.cs (rev 0)
+++ pkg/trunk/sandbox/web/sample_application/templates/index.cs 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,27 @@
+<html>
+<head>
+<?cs include:"includes.cs" ?>
+</head>
+
+<body onload="ros_handleOnLoad('/ros')">
+<?cs include:"header.cs" ?>
+<h3>Sample Application</h3>
+
+<table align=right>
+<td>
+<input class=app_button type=button value="" objtype="LaunchButtonWidget2" topic="/app_update" taskid="<?cs var:CGI.cur.app.taskid ?>">
+<div class=app_status objtype=TextWidget topic="/app_update" key=status selector="taskid" selectorValue="<?cs var:CGI.cur.app.taskid?>"> </div>
+</td>
+</table>
+
+<table width=80% align=center>
+<tr>
+<td>
+<div style="align: center; border: 1px solid black; font-size: 10pt; font-family: courier; height: 40em; width: 60em;" objtype=ScrollingTextWidget topic="/chatter"></div><br>
+</td>
+</table>
+
+<div id=ErrorDiv></div>
+
+</body>
+</html>
Property changes on: pkg/trunk/sandbox/web/sample_application/templates/index.cs
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/trunk/sandbox/web/webui/src/webui/cgistarter.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/cgistarter.py (rev 0)
+++ pkg/trunk/sandbox/web/webui/src/webui/cgistarter.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,342 @@
+#! /usr/bin/env python
+
+import os, sys, string, time, string
+from pyclearsilver.log import *
+from pyclearsilver import httpResponses
+import subprocess
+
+import roslib
+
+#debugfull()
+debugoff()
+
+import gc
+
+try:
+ import warnings
+ warnings.resetwarnings()
+ warnings.filterwarnings("ignore")
+except ImportError:
+ pass
+
+import neo_cgi, neo_cs, neo_util
+
+from pyclearsilver import CSPage
+
+import mimetypes
+mimetypes.init(["/etc/mime.types"])
+
+
+gConfig = None
+def setConfig(config):
+ global gConfig
+ gConfig = config
+
+ if not hasattr(gConfig, "gRequireUsername"): gConfig.gRequireUsername = 0
+ if not hasattr(gConfig, "gDataFilePaths"): gConfig.gDataFilePaths = []
+
+
+def split_path(path):
+ # strip off leading slash, it's no fun!
+ return string.split(path, '/')[1:]
+
+def getPackagePath(pkg):
+ cmd = ["rospack", "find", pkg]
+ pkgpath = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].strip()
+ return pkgpath
+
+
+class Page:
+ def __init__(self, context):
+ self.context = context
+
+ def setupvars(self):
+
+ self.path = self.context.environ.get("PATH_INFO", '')
+
+ script_name = self.context.environ.get("SCRIPT_NAME",'')
+
+ ## handle the case where the site is located at '/'
+ if not self.path:
+ self.path = script_name
+ script_name = '/'
+
+
+ def start(self):
+ self.setupvars()
+
+ self._path = self.path
+
+ rpath = self._path
+ if not rpath: rpath = '/'
+
+ if rpath == "/": rpath = gConfig.gDefaultPage
+
+ self.path = split_path(rpath)
+
+ username = None
+
+ if len(self.path) == 0:
+ warn("no such path", self.path)
+ self.error(404)
+ return 404
+
+ ## the url form should be:
+ ## /baseuri/username/module/script.py
+
+ cwd = os.getcwd()
+ debug("CWD", cwd)
+
+ module = gConfig.gDefaultModule
+
+ if hasattr(gConfig, "gDataFilePaths"):
+ if self.path[0] in gConfig.gDataFilePaths:
+ fn = apply(os.path.join, [cwd,] + self.path)
+ return outputFile(self.context, fn)
+
+ if gConfig.gRequireUsername:
+ username = self.path[0]
+ n = 1
+ else:
+ n = 0
+
+ debug("self.path", self.path)
+
+ if len(self.path) > 1:
+ module = self.path[n]
+ n = n + 1
+
+ modpath = None
+ app = None
+ if module == "app":
+ module = self.path[n]
+ app = module
+ n = n + 1
+
+ modpath = getPackagePath(module)
+ #roslib.load_manifest(module)
+
+ fn = apply(os.path.join, [modpath] + self.path[n:])
+ moduleRootPath = modpath
+ handlerRoot = apply(os.path.join, [modpath, "cgibin"])
+ moduleTemplatePath = apply(os.path.join, [modpath, "templates"])
+ else:
+ moduleRootPath = apply(os.path.join, ["mod", module])
+ handlerRoot = apply(os.path.join, ["mod", module, "cgibin"])
+ moduleTemplatePath = apply(os.path.join, [cwd, "mod", module, "templates"])
+
+ fn = apply(os.path.join, [cwd, moduleRootPath,] + self.path[n:])
+
+ systemTemplatePath = apply(os.path.join, [cwd, "mod", "webui", "templates"])
+ systemJLIBPath = apply(os.path.join, [cwd, "mod", "webui", "jslib"])
+
+ debug("fn", fn)
+
+ ## if requesting a file, then just output it to the browser.
+ if os.path.isfile(fn):
+ return outputFile(self.context, fn)
+
+ ## manage the Python module Path
+ sys.path.insert(0, os.path.abspath(cwd))
+ if modpath: sys.path.insert(0, os.path.abspath(modpath))
+ sys.path.insert(0, os.path.abspath(moduleRootPath))
+
+ debug("sys.path", sys.path)
+
+ handlerPath = ''
+
+ ## find the first *real* file in the path
+ ## the rest of the path becomes the pathinfo.
+ m = n
+ for m in range(len(self.path)-1, n-2, -1):
+ handlerPath = apply(os.path.join, [handlerRoot, ] + self.path[n:m+1])
+# warn(m, len(self.path), handlerPath)
+
+ if os.path.isdir(handlerPath):
+ sys.path.insert(0, handlerPath)
+ if os.path.isfile(handlerPath): break
+ if os.path.isdir(handlerPath): break
+
+ if m+1 == len(self.path):
+ pathinfo = ''
+ else:
+ pathinfo = apply(os.path.join, self.path[m+1:])
+
+ if os.path.isdir(handlerPath):
+ modulePath = handlerPath
+ moduleFilename = module + "_index.py"
+ handlerPath = os.path.join(modulePath, moduleFilename)
+ else:
+ modulePath, moduleFilename = os.path.split(handlerPath)
+
+ debug(handlerPath, pathinfo)
+ #warn("PATH", handlerPath, pathinfo, modulePath, moduleFilename)
+ #warn("PATH", self.path)
+
+ if not os.path.isfile(handlerPath):
+ self.error(404, handlerPath + " doesn't exist")
+ return 404
+
+ import imp
+
+ moduleName, ext = os.path.splitext(moduleFilename)
+
+ #module = __import__(moduleName)
+ if app:
+ module = __import__("cgibin.%s" % (moduleName, ), {}, {}, (None,))
+ else:
+ module = __import__("mod.%s.cgibin.%s" % (module, moduleName), {}, {}, (None,))
+
+ os.chdir(modulePath)
+# debug(mod)
+ page = module.run(self.context)
+ page.ncgi.hdf.setValue("CGI.BaseURI", gConfig.gBaseURL)
+
+ if gConfig.gRequireUsername:
+ page.ncgi.hdf.setValue("CGI.Username", username)
+ page.username = username
+
+ if hasattr(page, "checkLoginCookie"):
+ if not page._pageparms.has_key("nologin"):
+ try:
+ page.checkLoginCookie()
+ except CSPage.Redirected:
+ return
+
+ page.ncgi.hdf.setValue("CGI.PathInfo", pathinfo)
+ page.clearPaths()
+ page.setPaths([moduleTemplatePath, systemTemplatePath, systemJLIBPath])
+ ret = page.start()
+
+ try:
+ page.db.close()
+ except AttributeError: pass
+
+ page = None
+
+ return ret
+
+ def error(self, ecode, reason=None):
+ message = httpResponses.gHTTPResponses[ecode]
+
+ template = httpResponses.errorMessage_Default
+ if ecode == 404:
+ template = httpResponses.errorMessage_404
+
+ hdf = neo_util.HDF()
+ hdf.setValue("code", str(ecode))
+ if message: hdf.setValue("message", message)
+ if reason: hdf.setValue("reason", reason)
+
+ for key,val in self.context.environ.items():
+ hdf.setValue("environ." + key, str(val))
+
+ self.context.stdout.write("Content-Type: text/html\r\n")
+ self.context.setStatus(None, ecode)
+ self.context.stdout.write("Status: %s\r\n" % ecode)
+ self.context.stdout.write("\r\n")
+
+ cs = neo_cs.CS(hdf)
+ cs.parseStr(template)
+ page = cs.render()
+
+ self.context.stdout.write(page)
+
+ warn("Error", message, reason)
+
+
+def outputFile(context, fn):
+ fp = open(fn, "rb")
+ data = fp.read()
+ fp.close()
+
+ context.setStatus(None, 200)
+
+ imagetype, encoding = mimetypes.guess_type(fn)
+ debug("imagetype = %s fn = %s" % (imagetype,fn))
+
+ lines = []
+
+ if imagetype:
+ lines.append("Content-Type: %s" % imagetype)
+
+ lines.append("Content-Length: %d" % len(data))
+
+ stat = os.stat(fn)
+ mtime = stat.st_mtime
+ mod_str = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime(mtime))
+
+ lines.append('Last-Modified: %s GMT' % mod_str)
+
+ expire_time = time.gmtime(time.time() + (360*24*3600))
+ expire_str = time.strftime("%a, %d %b %Y %H:%M:%S", expire_time)
+ lines.append('Expires: %s GMT' % expire_str)
+
+ lines.append("\r\n")
+
+ headers = string.join(lines, "\r\n")
+ context.stdout.write(headers)
+
+ context.stdout.write(data)
+
+ return 200
+
+
+class FakeError:
+ def write(self, s):
+ apache.log_error(s, apache.APLOG_STARTUP)
+
+class ModPythonContext:
+ def __init__ (self, req):
+
+ from mod_python import apache
+
+ self.stdout = apache.CGIStdout(req)
+ self.stdin = apache.CGIStdin(req)
+
+ self.stderr = FakeError()
+ env = apache.build_cgi_env(req)
+
+ self.environ = env
+
+ scriptFilename = self.environ.get("SCRIPT_FILENAME", "")
+ if scriptFilename:
+ path, fn = os.path.split(scriptFilename)
+ os.chdir(path)
+
+ def setStatus(self, request, status):
+ if request:
+ request['status'] = str(status)
+
+
+
+def handler(req):
+ start = time.time()
+
+ from mod_python import apache
+
+ if 1:
+ context = ModPythonContext(req)
+ page = Page(context)
+ page.mod_python_req = req
+
+ gc.enable()
+ ret = page.start()
+ gc.collect()
+
+ ret = apache.OK
+
+ end = time.time()
+ #sys.stderr.write("handler time %s\n" % int((end-start)*1000))
+
+ return ret
+
+
+def main(argv, stdout, environ):
+ context = CSPage.Context()
+ page = Page(context)
+ page.start()
+
+
+if __name__ == "__main__":
+ main(sys.argv, sys.stdout, os.environ)
Property changes on: pkg/trunk/sandbox/web/webui/src/webui/cgistarter.py
___________________________________________________________________
Added: svn:executable
+ *
Added: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/appcon.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/appcon.py (rev 0)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/appcon.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -0,0 +1,67 @@
+#! /usr/bin/env python
+
+"""
+usage: %(progname)s
+ install [taskid]
+ remove [taskid]
+ list
+"""
+
+
+import os, sys, string, time, getopt
+
+PKG = 'webui' # this package name
+import roslib; roslib.load_manifest(PKG)
+
+from pyclearsilver.log import *
+
+import db_webui
+
+def test():
+ pass
+
+def usage(progname):
+ print __doc__ % vars()
+
+def main(argv, stdout, environ):
+ progname = argv[0]
+ optlist, args = getopt.getopt(argv[1:], "", ["help", "test", "debug"])
+
+ testflag = 0
+ if len(args) == 0:
+ usage(progname)
+ return
+ for (field, val) in optlist:
+ if field == "--help":
+ usage(progname)
+ return
+ elif field == "--debug":
+ debugfull()
+ elif field == "--test":
+ testflag = 1
+
+ if testflag:
+ test()
+ return
+
+ db = db_webui.initSchema()
+
+ cmd = args[0]
+ args = args[1:]
+
+ if cmd == "list":
+ apps = db.apps.listApps()
+ for app in apps:
+ print app.taskid
+ elif cmd == "install":
+ for taskid in args:
+ db.apps.installApp(taskid)
+ elif cmd == "remove":
+ for taskid in args:
+ db.apps.removeApp(taskid)
+
+
+
+
+if __name__ == "__main__":
+ main(sys.argv, sys.stdout, os.environ)
Property changes on: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/appcon.py
___________________________________________________________________
Added: svn:executable
+ *
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/db_webui.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/db_webui.py 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/db_webui.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -81,11 +81,21 @@
row.taskid = taskid
row.save()
+ def removeApp(self, taskid):
+ row = self.lookup(taskid=taskid)
+ row.delete()
+
+ def listApps(self):
+ rows = self.fetchAllRows()
+ return rows
+
class Application(hdfhelp.HdfRow):
def fetchApp(self, prefix, hdf):
_app = app.App(str(self.taskid))
doc = _app.load_yaml()
+ hdf.setValue(prefix + "." + "package", _app.package)
+
for key, val in doc.items():
if val is not None:
hdf.setValue(prefix + "." + key, val)
Deleted: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/install_app.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/install_app.py 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/install_app.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -1,53 +0,0 @@
-#! /usr/bin/env python
-
-"""
-usage: %(progname)s [args]
-"""
-
-
-import os, sys, string, time, getopt
-
-PKG = 'webui' # this package name
-import roslib; roslib.load_manifest(PKG)
-
-from pyclearsilver.log import *
-
-import db_webui
-
-def test():
- pass
-
-def usage(progname):
- print __doc__ % vars()
-
-def main(argv, stdout, environ):
- progname = argv[0]
- optlist, args = getopt.getopt(argv[1:], "", ["help", "test", "debug"])
-
- testflag = 0
- if len(args) == 0:
- usage(progname)
- return
- for (field, val) in optlist:
- if field == "--help":
- usage(progname)
- return
- elif field == "--debug":
- debugfull()
- elif field == "--test":
- testflag = 1
-
- if testflag:
- test()
- return
-
- db = db_webui.initSchema()
-
-
- for appfn in args:
- db.apps.installApp(appfn)
-
-
-
-if __name__ == "__main__":
- main(sys.argv, sys.stdout, os.environ)
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/pr2_widgets.js 2009-08-27 05:37:29 UTC (rev 23108)
@@ -28,7 +28,7 @@
init: function() {
this.img = new Image();
- this.img.src = 'templates/images/toolbar/battery_gray.png';
+ this.img.src = '/webui/webui/templates/images/toolbar/battery_gray.png';
this.domobj.innerHTML = '<canvas width=41 height=16></canvas><span style="font-size:11px;position:relative;top:-3"></span>'
var width = this.domobj.getAttribute("width");
@@ -80,7 +80,7 @@
src = 'orange_ball.png';
else
src = 'red_ball.png';
- html += '<img src="templates/images/toolbar/' + src + '"> ';
+ html += '<img src="/webui/webui/templates/images/toolbar/' + src + '"> ';
}
html += '</span>';
this.domobj.innerHTML = html;
@@ -109,7 +109,7 @@
} else {
src = 'battery_power.png';
}
- this.domobj.innerHTML = '<img src="templates/images/toolbar/' + src + '"> ';
+ this.domobj.innerHTML = '<img src="/webui/webui/templates/images/toolbar/' + src + '"> ';
}
});
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros.js
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros.js 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros.js 2009-08-27 05:37:29 UTC (rev 23108)
@@ -261,6 +261,8 @@
},
receive: function(msg) {
+ if(!this.selector || !this.selectorValue) return;
+
if(this.selector && this.selectorValue) {
if(msg[this.selector] != this.selectorValue) return;
}
@@ -307,14 +309,16 @@
this.pump = null;
this.domobj = domobj;
this.topics = [domobj.getAttribute("topic")];
- this.maxlines = parseInt(domobj.getAttribute("maxlines", "100"));
+ this.maxlines = domobj.getAttribute("maxlines");
+ if(!this.maxlines) this.maxlines = 40;
+ else this.maxlines = parseInt(this.maxlines);
this.textdiv = null;
},
init: function() {
this.domobj.style.position = "absolute";
- this.domobj.style.overflow = "auto";
+ this.domobj.style.overflowY = "scroll";
this.textdiv = document.createElement("div");
this.domobj.appendChild(this.textdiv);
@@ -432,14 +436,16 @@
this.pump = null;
this.domobj = domobj;
this.topics = ['/rosout'];
- this.maxlines = parseInt(domobj.getAttribute("maxlines", "100"));
+ this.maxlines = domobj.getAttribute("maxlines");
+ if(!this.maxlines) this.maxlines = 100;
+ else this.maxlines = parseInt(this.maxlines);
this.tbl = null;
},
init: function() {
this.domobj.style.position = "absolute";
- this.domobj.style.overflow = "auto";
+ this.domobj.style.overflowY = "scroll";
this.tbl = document.createElement("table");
this.tbl.width = "100%";
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros_toolbar.js
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros_toolbar.js 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/jslib/ros_toolbar.js 2009-08-27 05:37:29 UTC (rev 23108)
@@ -25,17 +25,22 @@
receive: function(msg) {
if(msg.taskid != this.taskid) return;
+
+ var prev_state = this.state;
var state = msg.status;
if(state == "running") this.state = true;
if(state == "stopped") this.state = false;
- var button = this.domobj;
- if(button != null) {
- if(this.state == true) {
- button.setAttribute("class", "buttonOn");
- } else {
- button.setAttribute("class", "buttonOff");
+ if(prev_state != this.state) {
+ var button = this.domobj;
+ if(button != null) {
+ this.domobj.style.border = "solid";
+ if(this.state == true) {
+ button.setAttribute("class", "buttonOn");
+ } else {
+ button.setAttribute("class", "buttonOff");
+ }
}
}
},
@@ -43,6 +48,7 @@
onmousedown: function(evt) {
var newstate = !this.state;
+ this.domobj.style.border = "dotted";
if(newstate) {
this.pump.service_call("start_task", {'taskid':this.taskid, 'username':'anonymous'});
} else {
@@ -58,6 +64,69 @@
// *******************************************
+
+var LaunchButtonWidget2 = Class.create({
+ initialize: function(domobj) {
+ this.pump = null;
+ this.domobj = domobj;
+ this.taskid = domobj.getAttribute("taskid");
+ this.state = false;
+ this.topics = [domobj.getAttribute("topic")];
+ },
+
+ init: function() {
+ var obj = this;
+ this.domobj.onmousedown = function() {obj.onmousedown();};
+
+ this.set_state();
+ },
+
+ receive: function(msg) {
+ if(msg.taskid != this.taskid) return;
+
+ var prev_state = this.state;
+
+ var state = msg.status;
+ if(state == "running") this.state = true;
+ if(state == "stopped") this.state = false;
+
+ if(prev_state != this.state) {
+ this.set_state(this.state);
+ }
+ },
+
+ set_state: function() {
+ if(this.domobj == null) return;
+
+ if(this.state == true) {
+ // this.domobj.disabled = 0;
+ this.domobj.value = "Stop";
+ } else if (this.state == false) {
+ // this.domobj.disabled = 0;
+ this.domobj.value = "Launch";
+ } else {
+ this.domobj.disabled = 1;
+ this.domobj.value = "";
+ }
+ },
+
+ onmousedown: function(evt) {
+ var newstate = !this.state;
+
+ if(newstate) {
+ this.pump.service_call("start_task", {'taskid':this.taskid, 'username':'anonymous'});
+ } else {
+ this.pump.service_call("stop_task", {'taskid':this.taskid, 'username':'anonymous'});
+ }
+ }
+});
+
+gRosClasses["LaunchButtonWidget2"] = function(dom){
+ return new LaunchButtonWidget2(dom);
+}
+
+// *******************************************
+
var ActiveTasks = Class.create({
initialize: function(domobj) {
this.pump = null;
@@ -72,7 +141,7 @@
receive: function(msg) {
var s = "";
for(var i=0; i<msg.active.length; i++) {
- s = s + "|" + msg.active[i];
+ s = s + "|" + "<a href='/webui/app/" + msg.active[i].taskid + "'>" + msg.active[i].name + "</a>";
}
this.domobj.innerHTML = s;
}
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/apps.cs
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/apps.cs 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/apps.cs 2009-08-27 05:37:29 UTC (rev 23108)
@@ -8,7 +8,7 @@
<?cs include:"header.cs" ?>
<br>
-
+<?cs if:0 ?>
<table align=center cellspacing=5>
<tr>
<?cs each:_app=CGI.cur.apps ?>
@@ -16,21 +16,29 @@
<?cs /each ?>
</tr>
</table>
+<?cs /if ?>
-
-<table width=80% align=center cellpadding=0 cellspacing=0>
+<table width=30% cellspacing=5>
+<?cs each:_app=CGI.cur.apps ?>
+<tr><td>
+<table class=app border=0>
<tr>
-<td width=100%>
-<table class=rosout><tr>
-<td class=rosoutHeading style="width: 5%;">Severity</td>
-<td class=rosoutHeading style="width: 80%;">Message</td>
-<td class=rosoutHeading style="width: 15%;">Node</td>
-</table>
-<div class=rosoutWidget objtype=RosOut_Widget></div><br>
+<td width=1% onclick="document.location='<?cs var:CGI.ScriptName?>/app/<?cs var:_app.package ?>/';"><img src="<?cs var:CGI.ScriptName?>/app/<?cs var:_app.package ?>/<?cs var:_app.icon?>" width=100 height=100 border=0></td>
+<td class=app_bar>
+<div class=app_name><?cs var:_app.name ?></div>
+<div class=app_description><?cs var:_app.description ?></div>
</td>
+<td valign=top>
+<input class=app_button type=button value="" objtype="LaunchButtonWidget2" topic="/app_update" taskid="<?cs var:_app.taskid ?>">
+<div class=app_status objtype=TextWidget topic="/app_update" key=status selector="taskid" selectorValue="<?cs var:_app.taskid?>"> </div>
+</td>
</tr>
</table>
+</td></tr>
+<?cs /each ?>
+</table>
+
<br>
<div id=ErrorDiv></div>
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/header.cs
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/header.cs 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/header.cs 2009-08-27 05:37:29 UTC (rev 23108)
@@ -1,17 +1,17 @@
<table class=toolbar width=100% cellspacing=0 cellpadding=2>
<tr>
<td width=1%><nobr>Robot: <?cs var:CGI.ServerName?></td>
-<td width=1%><img src="templates/images/toolbar/grid-blue-split.gif"></td>
+<td width=1%><img src="<?cs var:CGI.ScriptName?>/webui/templates/images/toolbar/grid-blue-split.gif"></td>
<td width=90%><nobr>Core Status: <font color=green>Running</font>
<span objtype=ActiveTasks topic="/app_status"/>
</nobr>
</td>
-<td width=1%><img src="templates/images/toolbar/grid-blue-split.gif"></td>
+<td width=1%><img src="<?cs var:CGI.ScriptName?>/webui/templates/images/toolbar/grid-blue-split.gif"></td>
<td width=1%><nobr><div objtype=CircuitMonitor topic="/power_board_state"/></td>
-<td width=1%><img src="templates/images/toolbar/grid-blue-split.gif"></td>
+<td width=1%><img src="<?cs var:CGI.ScriptName?>/webui/templates/images/toolbar/grid-blue-split.gif"></td>
<td width=1%><nobr><div objtype=ChargeMonitor topic="/power_board_state"/></td>
<td width=1%><nobr><div objtype=BatteryMonitor topic="/battery_state"/></td>
-<td width=1%><img src="templates/images/toolbar/grid-blue-split.gif"></td>
+<td width=1%><img src="<?cs var:CGI.ScriptName?>/webui/templates/images/toolbar/grid-blue-split.gif"></td>
<?cs if:CGI.Login ?>
<td align=right><a href="<?cs var:CGI.ScriptName ?>/login/signin.py?signout=1" class=tablink>Logout</a>(<?cs var:CGI.Login ?>)</td>
<?cs else ?>
@@ -22,26 +22,19 @@
<table class=head_buttons width=100%>
<tr>
-<td class=head_buttons width=1% onclick="javascript:location.href='apps.py'">Apps</a></td>
-<!--<td class=head_buttons width=1% onclick="javascript:location.href='move.py'">Move</td> -->
-<td class=head_buttons width=1% onclick="javascript:location.href='topics.py'">Topics</a></td>
-<td class=head_buttons width=1% onclick="javascript:location.href='nodes.py'">Nodes</td>
-<td class=head_buttons width=1% onclick="javascript:location.href='powerboard.py'">Power</td>
-<td class=head_buttons width=1% onclick="javascript:location.href='status.py'">Status</a></td>
-<td class=head_buttons width=1% onclick="javascript:location.href='admin.py'">Admin</a></td>
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/apps.py'">Apps</a></td>
+<!--<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/move.py'">Move</td> -->
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/topics.py'">Topics</a></td>
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/nodes.py'">Nodes</td>
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/powerboard.py'">Power</td>
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/status.py'">Status</a></td>
+<td class=head_buttons width=1% onclick="javascript:location.href='<?cs var:CGI.ScriptName?>/webui/admin.py'">Admin</a></td>
<?cs if:CGI.Login=="hassan"?><td width=1%><a href="<?cs var:CGI.ScriptName ?>/webui/tables.py/" class=tablink>Tables</a></td><?cs /if ?>
</tr>
</table>
-<table style="border: 1px solid black; width: 150px; float: right">
-<tr>
-<td objtype="ListWidget" topic="/users" key="users">
- __item__<br>
-</td>
-</tr>
-</table>
</td></tr>
<tr><td>
</td></tr>
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/includes.cs
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/includes.cs 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/includes.cs 2009-08-27 05:37:29 UTC (rev 23108)
@@ -1,21 +1,18 @@
+<link rel="stylesheet" type="text/css" href="<?cs var:CGI.ScriptName?>/webui/templates/<?cs var:CGI.cur.device_style?>">
-<link rel="stylesheet" type="text/css" href="templates/<?cs var:CGI.cur.device_style?>">
+<title>RosWeb: <?cs var:CGI.ServerName?></title>
- <title>RosWeb: <?cs var:CGI.ServerName?></title>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/prototype.js"></script>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/ros.js"></script>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/ros_toolbar.js"></script>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/pr2_graph.js"></script>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/pr2_pb.js"></script>
+<script type="text/javascript" src="<?cs var:CGI.ScriptName?>/webui/jslib/pr2_widgets.js"></script>
- <script type="text/javascript" src="jslib/prototype.js"></script>
-
- <script type="text/javascript" src="jslib/ros.js"></script>
- <script type="text/javascript" src="jslib/ros_toolbar.js"></script>
- <script type="text/javascript" src="jslib/pr2_graph.js"></script>
- <script type="text/javascript" src="jslib/pr2_pb.js"></script>
- <script type="text/javascript" src="jslib/pr2_widgets.js"></script>
-
<?cs if:0 ?>
- <script type='text/javascript' src='http://www.google.com/jsapi'></script>
- <script type='text/javascript'>
- google.load("visualization", "1", {packages:["linechart"]});
- google.load("visualization", "1", {packages:["gauge"]});
- </script>
+ <script type='text/javascript' src='http://www.google.com/jsapi'></script>
+ <script type='text/javascript'>
+ google.load("visualization", "1", {packages:["linechart"]});
+ google.load("visualization", "1", {packages:["gauge"]});
+ </script>
<?cs /if ?>
-
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/status.cs
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/status.cs 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/status.cs 2009-08-27 05:37:29 UTC (rev 23108)
@@ -1,24 +1,35 @@
<html>
- <head>
-
- <title>webui</title>
- <?cs include:"includes.cs" ?>
-
+<head>
+<?cs include:"includes.cs" ?>
</head>
<body onload="ros_handleOnLoad('/ros')">
<?cs include:"header.cs" ?>
<br>
-
<br>
-<div objtype=PowerboardGraphWidget topic="/diagnostics/Power board 0" width=640></div><br>
+<table style="border: 1px solid black; width: 150px; float: right">
+<tr>
+<td objtype="ListWidget" topic="/users" key="users">
+ __item__<br>
+</td>
+</tr>
+</table>
-<div objtype=PowerboardGraph2Widget topic="/diagnostics/Power board 0" width=640></div><br>
+<table width=80% align=center cellpadding=0 cellspacing=0>
+<tr>
+<td width=100%>
+<table class=rosout><tr>
+<td class=rosoutHeading style="width: 5%;">Severity</td>
+<td class=rosoutHeading style="width: 80%;">Message</td>
+<td class=rosoutHeading style="width: 15%;">Node</td>
+</table>
+<div class=rosoutWidget objtype=RosOut_Widget></div><br>
+</td>
+</tr>
+</table>
-<div objtype=PowerboardGraph3Widget topic="/battery_state" width=640></div><br>
-<div id=ErrorDiv></div>
</body>
</html>
Modified: pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/style_desktop.css
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/style_desktop.css 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/mod/webui/templates/style_desktop.css 2009-08-27 05:37:29 UTC (rev 23108)
@@ -182,6 +182,7 @@
border-width: 2px;
border-color: #222222;
width: 6em;
+ height: 100;
}
.buttonTitle {
@@ -272,3 +273,30 @@
padding-left: 5px;
}
+.app {
+ width: 100%;
+ border: 1px solid black;
+ overflow: hidden;
+ text-align: left;
+ font-family: arial,tahoma,helvetica,sans-serif;
+}
+
+.app_bar {
+ vertical-align: top;
+}
+
+.app_name {
+ font-size: 16px;
+}
+
+.app_status {
+ font-size: 12px;
+ text-align: center;
+}
+.app_button {
+ width: 5em;
+}
+
+.app_description {
+ font-size: 12px;
+}
Modified: pkg/trunk/sandbox/web/webui/src/webui/startcgi.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/startcgi.py 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/startcgi.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -25,7 +25,8 @@
ros_root = os.environ['ROS_ROOT']
os.environ['PATH'] = os.path.join(ros_root, "bin") + ":" + os.environ['PATH']
-from pyclearsilver import cgistarter, log
+from pyclearsilver import log
+from webui import cgistarter
import config
Modified: pkg/trunk/sandbox/web/webui/src/webui/startmod.py
===================================================================
--- pkg/trunk/sandbox/web/webui/src/webui/startmod.py 2009-08-27 05:09:26 UTC (rev 23107)
+++ pkg/trunk/sandbox/web/webui/src/webui/startmod.py 2009-08-27 05:37:29 UTC (rev 23108)
@@ -16,7 +16,7 @@
PKG = 'webui' # this package name
import roslib; roslib.load_manifest(PKG)
-from pyclearsilver import cgistarter
+from webui import cgistarter
from webui import config
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|