iwla

iwla Commit Details

Date:2020-05-01 09:57:24 (3 months 2 days ago)
Author:Grégory Soutadé
Branch:dev
Commit:32d09637c89d02acaf7d7621d5c64ee2f2a35f16
Parents: 363bd68281a775c3857810c4501dd2fd8e124039
Message:Bugfix: error in check for compress file creation

Changes:
Miwla.py (2 diffs)

File differences

iwla.py
132132
133133
134134
135
135
136136
137137
138138
......
572572
573573
574574
575
575
576576
577577
578578
579579
580580
581581
582
582
583583
584584
585585
586586
587
587
588588
589589
590590
591591
592592
593
593
594594
595595
596596
597597
598598
599599
600
601600
602
601
603602
604603
605604
ANALYSIS_CLASS = 'HTTP'
API_VERSION = 1
IWLA_VERSION = '0.5-dev'
IWLA_VERSION = '0.6'
def __init__(self, logLevel, dry_run):
self.meta_infos = {}
self.display.addPage(page)
def _compressFile(self, build_time, root, filename):
def _compressFile(self, root, filename):
path = os.path.join(root, filename)
gz_path = path + '.gz'
self.logger.debug('Compress %s => %s' % (path, gz_path))
if not os.path.exists(gz_path) or\
os.stat(path).st_mtime >= build_time:
os.stat(path).st_mtime > os.stat(gz_path).st_mtime:
if self.dry_run: return
with open(path, 'rb') as f_in, gzip.open(gz_path, 'wb') as f_out:
f_out.write(f_in.read())
def _compressFiles(self, build_time, root):
def _compressFiles(self, root):
if not conf.compress_output_files: return
for rootdir, subdirs, files in os.walk(root, followlinks=True):
for f in files:
for ext in conf.compress_output_files:
if f.endswith(ext):
self._compressFile(build_time, rootdir, f)
self._compressFile(rootdir, f)
break
def _generateDisplay(self):
self._generateDisplayDaysStats()
self._callPlugins(conf.DISPLAY_HOOK_DIRECTORY)
self._generateDisplayWholeMonthStats()
build_time = time.mktime(time.localtime())
self.display.build(conf.DISPLAY_ROOT)
self._compressFiles(build_time, conf.DISPLAY_ROOT)
self._compressFiles(conf.DISPLAY_ROOT)
def _createEmptyStats(self):
stats = {}

Archive Download the corresponding diff file

Branches

Tags