pvl.verkko.rrd: --rrd is required; fix overview rrd name layout
authorTero Marttila <terom@paivola.fi>
Sun, 20 Jan 2013 18:31:21 +0200
changeset 153 8930f54b59b4
parent 152 33b98b46d8fb
child 154 11df86fd2d67
pvl.verkko.rrd: --rrd is required; fix overview rrd name layout
bin/pvl.verkko-rrd
pvl/verkko/rrd.py
static/rrd.css
--- a/bin/pvl.verkko-rrd	Sun Jan 20 18:26:54 2013 +0200
+++ b/bin/pvl.verkko-rrd	Sun Jan 20 18:31:21 2013 +0200
@@ -52,6 +52,10 @@
     options, args = parse_argv(argv, doc=__doc__)
 
     # rrd
+    if not options.rrd :
+        log.error("no --rrd given")
+        return 2
+
     rrd = pvl.verkko.rrd.RRDDatabase(options.rrd)
 
     # app
--- a/pvl/verkko/rrd.py	Sun Jan 20 18:26:54 2013 +0200
+++ b/pvl/verkko/rrd.py	Sun Jan 20 18:31:21 2013 +0200
@@ -20,6 +20,9 @@
     """
 
     def __init__ (self, path) :
+        if not path :
+            raise ValueError("RRDDatabase: no path given")
+
         log.info("%s", path)
 
         self._path = path
@@ -218,7 +221,7 @@
         graph_url = self.url(Graph, tree=self.tree, target=rrd)
         
         return html.a(href=target_url)(
-                html.p(rrd),
+                html.h3(rrd),
                 html.img(src=graph_url),
         )
 
--- a/static/rrd.css	Sun Jan 20 18:26:54 2013 +0200
+++ b/static/rrd.css	Sun Jan 20 18:31:21 2013 +0200
@@ -40,8 +40,9 @@
     background-color: #eee;
 }
 
-#overview ul li div.title
+#overview ul li h3
 {
+    margin: 0px;
     padding: 5pt;
 }