Skip to content

Instantly share code, notes, and snippets.

@bdarnell
Created October 6, 2010 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarnell/614241 to your computer and use it in GitHub Desktop.
Save bdarnell/614241 to your computer and use it in GitHub Desktop.
dowser patch
diff --git a/tools/third_party/dowser/__init__.py b/tools/third_party/dowser/__init__.py
index fa562b1..d716a2a 100644
--- a/tools/third_party/dowser/__init__.py
+++ b/tools/third_party/dowser/__init__.py
@@ -54,6 +54,7 @@ class Root:
if cherrypy.__version__ >= '3.1':
cherrypy.engine.subscribe('exit', self.stop)
self.runthread = threading.Thread(target=self.start)
+ self.runthread.daemon = True
self.runthread.start()
def start(self):
@@ -97,7 +98,7 @@ class Root:
def stop(self):
self.running = False
- def index(self, floor=0):
+ def index(self, floor=0, graphs='false'):
rows = []
typenames = self.history.keys()
typenames.sort()
@@ -105,9 +106,13 @@ class Root:
hist = self.history[typename]
maxhist = max(hist)
if maxhist > int(floor):
- row = ('<div class="typecount">%s<br />'
- '<img class="chart" src="%s" /><br />'
- 'Min: %s Cur: %s Max: %s <a href="%s">TRACE</a></div>'
+ if graphs == 'true':
+ graph = '<img class="chart" src="%s" /><br />'
+ else:
+ graph = '<a href="%s">Graph</a><br />'
+ row = (('<div class="typecount">%s<br />' +
+ graph +
+ 'Min: %s Cur: %s Max: %s <a href="%s">TRACE</a></div>')
% (cgi.escape(typename),
url("chart/%s" % typename),
min(hist), hist[-1], maxhist,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment