author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-17 15:45:39 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-04-17 15:45:39 (UTC) |
commit | 48c9280c9a255f2a85ad5729830df884e64a9c5d (patch) (unidiff) | |
tree | 14787438153cdc0b4b445c66f046bccf3dd99ee2 /scripts/builder/backends/checksumBuilder.py | |
parent | 4ce8041b11afc7f02c678565e0e96e59a5a557b6 (diff) | |
download | clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.zip clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.tar.gz clipperz-48c9280c9a255f2a85ad5729830df884e64a9c5d.tar.bz2 |
Updated build script to handle 'checksum' target
The build script can now be invoked, for example, with the following options:
> ./scripts/build checksum --frontend beta gamma
Diffstat (limited to 'scripts/builder/backends/checksumBuilder.py') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | scripts/builder/backends/checksumBuilder.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/builder/backends/checksumBuilder.py b/scripts/builder/backends/checksumBuilder.py new file mode 100755 index 0000000..5f44c8a --- a/dev/null +++ b/scripts/builder/backends/checksumBuilder.py | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # -*- coding: UTF-8 -*- | ||
3 | |||
4 | import os | ||
5 | import shutil | ||
6 | import subprocess | ||
7 | import main | ||
8 | |||
9 | from backendBuilder import BackendBuilder | ||
10 | |||
11 | class ChecksumBuilder(BackendBuilder): | ||
12 | |||
13 | def name(self): | ||
14 | return "Checksum builder" | ||
15 | |||
16 | |||
17 | def relativePath(self): | ||
18 | return 'checksum' | ||
19 | |||
20 | |||
21 | def compileCode (self): | ||
22 | pass | ||
23 | |||
24 | |||
25 | def createPackage (self): | ||
26 | src = self.tempFolder() | ||
27 | dst = self.targetFolder() | ||
28 | |||
29 | shutil.copytree(src, dst) | ||
30 | |||
31 | |||
32 | def run (self): | ||
33 | print self.name() + " - RUN (checksum)" | ||
34 | |||
35 | for frontend in self.frontends: | ||
36 | if (frontend.module == frontend.submodule): | ||
37 | submoduleExtension = '' | ||
38 | else: | ||
39 | submoduleExtension = '.' + frontend.submodule | ||
40 | |||
41 | main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) | ||
42 | |||
43 | index = self.configureIndexContent(frontend.assemble()) | ||
44 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) | ||
45 | self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") | ||
46 | print "" | ||
47 | |||
48 | self.createPackage() | ||
49 | |||
50 | |||