2013-04-17 17:45:39 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import subprocess
|
|
|
|
import main
|
|
|
|
|
|
|
|
from backendBuilder import BackendBuilder
|
|
|
|
|
|
|
|
class ChecksumBuilder(BackendBuilder):
|
|
|
|
|
|
|
|
def name(self):
|
|
|
|
return "Checksum builder"
|
|
|
|
|
|
|
|
|
|
|
|
def relativePath(self):
|
|
|
|
return 'checksum'
|
|
|
|
|
|
|
|
|
|
|
|
def compileCode (self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def createPackage (self):
|
|
|
|
src = self.tempFolder()
|
|
|
|
dst = self.targetFolder()
|
|
|
|
|
|
|
|
shutil.copytree(src, dst)
|
|
|
|
|
|
|
|
|
|
|
|
def run (self):
|
|
|
|
print self.name() + " - RUN (checksum)"
|
|
|
|
|
|
|
|
for frontend in self.frontends:
|
|
|
|
if (frontend.module == frontend.submodule):
|
|
|
|
submoduleExtension = ''
|
|
|
|
else:
|
|
|
|
submoduleExtension = '.' + frontend.submodule
|
|
|
|
|
|
|
|
main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module))
|
|
|
|
|
|
|
|
index = self.configureIndexContent(frontend.assemble())
|
|
|
|
self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)
|
2014-07-28 18:07:48 +02:00
|
|
|
frontend.copyResourcesToFolder(self.frontEndTempFolder())
|
2013-04-17 17:45:39 +02:00
|
|
|
self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum")
|
|
|
|
print ""
|
|
|
|
|
|
|
|
self.createPackage()
|
|
|
|
|
|
|
|
|