Correct PATH in the Web export module

pull/104/merge
Nicolas Hennion 2012-10-23 21:19:54 +02:00
parent 99f1377a42
commit 8ba41b7b8a
1 changed files with 6 additions and 3 deletions

View File

@ -1937,10 +1937,13 @@ class glancesHtml:
# Init refresh time
self.__refresh_time = refresh_time
# Set the root path
self.root_path = htmlfolder + '/'
# Set the templates path
environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(htmlfolder + '/html'),
loader=jinja2.FileSystemLoader(self.root_path + 'html'),
extensions=['jinja2.ext.loopcontrols'])
# Open the template
@ -1999,7 +2002,7 @@ class glancesHtml:
elif current > limits.getLOADWarning(core):
return 'WARNING'
elif current > limits.getLOADCareful(core):
return 'CAREFUL'
return 'CAREFUL'
return 'OK'
def __getLoadColor(self, load, core=1):
@ -2032,7 +2035,7 @@ class glancesHtml:
def update(self, stats):
if stats.getCpu():
# Open the output file
f = open('glances.html', 'w')
f = open(self.root_path + 'glances.html', 'w')
# Process color