rrd.py: create output directory if it does not exist yet

alfred-data
Nils Schneider 2013-11-23 22:16:35 +01:00
parent 4f889b102f
commit 8ee4cbcf24
1 changed files with 6 additions and 1 deletions

7
rrd.py
View File

@ -15,10 +15,15 @@ class rrd:
self.imagePath = imagePath self.imagePath = imagePath
self.displayTimeGlobal = displayTimeGlobal self.displayTimeGlobal = displayTimeGlobal
self.displayTimeNode = displayTimeNode self.displayTimeNode = displayTimeNode
self.currentTimeInt = (int(time.time())/60)*60 self.currentTimeInt = (int(time.time())/60)*60
self.currentTime = str(self.currentTimeInt) self.currentTime = str(self.currentTimeInt)
try:
os.stat(self.imagePath)
except:
os.mkdir(self.imagePath)
def checkAndCreateIfNeededGlobalDatabase(self): def checkAndCreateIfNeededGlobalDatabase(self):
""" Creates the global database file iff it did not exist. """ Creates the global database file iff it did not exist.
""" """