From 8ee4cbcf24121ff0c12a6213a67e66fe09264d73 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sat, 23 Nov 2013 22:16:35 +0100 Subject: [PATCH] rrd.py: create output directory if it does not exist yet --- rrd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rrd.py b/rrd.py index ddc25b5..896a4b7 100755 --- a/rrd.py +++ b/rrd.py @@ -15,10 +15,15 @@ class rrd: self.imagePath = imagePath self.displayTimeGlobal = displayTimeGlobal self.displayTimeNode = displayTimeNode - + self.currentTimeInt = (int(time.time())/60)*60 self.currentTime = str(self.currentTimeInt) + try: + os.stat(self.imagePath) + except: + os.mkdir(self.imagePath) + def checkAndCreateIfNeededGlobalDatabase(self): """ Creates the global database file iff it did not exist. """