Replace getCurDisplayRoot() by getCurDisplayPath()
This commit is contained in:
10
iwla.py
10
iwla.py
@@ -84,9 +84,9 @@ class IWLA(object):
|
||||
def hasBeenViewed(self, request):
|
||||
return int(request['status']) in conf.viewed_http_codes
|
||||
|
||||
def getCurDisplayRoot(self):
|
||||
def getCurDisplayPath(self, filename):
|
||||
cur_time = self.meta_infos['last_time']
|
||||
return '%d/%d/' % (cur_time.tm_year, cur_time.tm_mon)
|
||||
return os.path.join(str(cur_time.tm_year), str(cur_time.tm_mon), filename)
|
||||
|
||||
def _clearMeta(self):
|
||||
self.meta_infos = {
|
||||
@@ -99,7 +99,7 @@ class IWLA(object):
|
||||
return self.display
|
||||
|
||||
def getDBFilename(self, time):
|
||||
return (conf.DB_ROOT + '%d/%d/%s') % (time.tm_year, time.tm_mon, conf.DB_FILENAME)
|
||||
return os.path.join(conf.DB_ROOT, str(time.tm_year), str(time.tm_mon), conf.DB_FILENAME)
|
||||
|
||||
def _serialize(self, obj, filename):
|
||||
base = os.path.dirname(filename)
|
||||
@@ -220,14 +220,14 @@ class IWLA(object):
|
||||
|
||||
def getDisplayIndex(self):
|
||||
cur_time = self.meta_infos['last_time']
|
||||
filename = '%s/index.html' % (self.getCurDisplayRoot())
|
||||
filename = self.getCurDisplayPath('index.html')
|
||||
|
||||
return self.display.getPage(filename)
|
||||
|
||||
def _generateDisplayDaysStat(self):
|
||||
cur_time = self.meta_infos['last_time']
|
||||
title = 'Stats %d/%d' % (cur_time.tm_mon, cur_time.tm_year)
|
||||
filename = '%s/index.html' % (self.getCurDisplayRoot())
|
||||
filename = self.getCurDisplayPath('index.html')
|
||||
print '==> Generate display (%s)' % (filename)
|
||||
page = DisplayHTMLPage(title, filename)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user