summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/rrdui.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/rrdui.py b/tools/rrdui.py
index ee10eae..a4debf4 100644
--- a/tools/rrdui.py
+++ b/tools/rrdui.py
@@ -18,10 +18,10 @@ class GraphDef:
__config = None
- def __init__(self, category, name):
- self.filename = "%s/%s/%s" % (CONFDIR, category, name)
- self.filedata = "%s/%s-%s.rrd" % (WORKDIR, category, name)
- self.category = category
+ def __init__(self, name):
+ self.filename = "%s/%s" % (CONFDIR, name)
+ self.filedata = "%s/%s.rrd" % (WORKDIR, name)
+ self.category = "All"
self.name = name
cfg = self.__config = ConfigParser.RawConfigParser()
@@ -30,6 +30,8 @@ class GraphDef:
# Loading general stuff
if cfg.has_option("general", "title"):
self.title = cfg.get("general", "title")
+ if cfg.has_option("general", "category"):
+ self.title = cfg.get("general", "category")
# Loading graph stuff
if cfg.has_option("graph", "width"):
@@ -85,12 +87,10 @@ def loadGraphs():
# List files and add appropriate paths
graphs = []
- for category in os.listdir(CONFDIR):
- dir = "%s/%s" % (CONFDIR, category)
- if not os.path.isdir(dir):
+ for file in os.listdir(CONFDIR):
+ if os.path.isdir(file):
continue
- for f in os.listdir(dir):
- graphs.append(GraphDef(category, f))
+ graphs.append(GraphDef(file))
return graphs