author | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-08-30 15:56:53 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@clipperz.com> | 2013-08-30 21:23:42 (UTC) |
commit | 20bea94ab6b91c85b171dcf86baba0a64169d508 (patch) (unidiff) | |
tree | 6e38e91498dcdb861620eba1e237d1026fe79cc5 /scripts/builder/backendBuilder.py | |
parent | bde3c7b98523112ade9c5bbf7390c4ecb494cd2e (diff) | |
download | clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.zip clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.gz clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.bz2 |
First release of /delta version
Diffstat (limited to 'scripts/builder/backendBuilder.py') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | scripts/builder/backendBuilder.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index b4ee990..ad6595c 100755 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py | |||
@@ -47,51 +47,54 @@ class BackendBuilder(object): | |||
47 | def tempFolder (self): | 47 | def tempFolder (self): |
48 | return os.path.join(self.projectTargetDir, '.tmp', self.relativePath()) | 48 | return os.path.join(self.projectTargetDir, '.tmp', self.relativePath()) |
49 | 49 | ||
50 | 50 | ||
51 | def frontEndTempFolder (self): | 51 | def frontEndTempFolder (self): |
52 | return self.tempFolder() | 52 | return self.tempFolder() |
53 | 53 | ||
54 | 54 | ||
55 | def developmentTargetFolder (self): | 55 | def developmentTargetFolder (self): |
56 | return os.path.join(self.projectTargetDir, 'development') | 56 | return os.path.join(self.projectTargetDir, 'development') |
57 | 57 | ||
58 | 58 | ||
59 | def targetFolder (self): | 59 | def targetFolder (self): |
60 | return os.path.join(self.projectTargetDir, self.relativePath()) | 60 | return os.path.join(self.projectTargetDir, self.relativePath()) |
61 | 61 | ||
62 | 62 | ||
63 | # -------------------------------------------------------------------------- | 63 | # -------------------------------------------------------------------------- |
64 | 64 | ||
65 | def writeToFolder (self, folder, filename, content): | 65 | def writeToFolder (self, folder, filename, content): |
66 | file = open(os.path.join(folder, filename), 'w') | 66 | file = open(os.path.join(folder, filename), 'w') |
67 | file.write(content.encode('utf-8')) | 67 | file.write(content.encode('utf-8')) |
68 | file.close() | 68 | file.close() |
69 | 69 | ||
70 | 70 | ||
71 | def configureIndexContent (self, indexContent, requestPathPrefix = ".."): | 71 | #def configureIndexContent (self, indexContent, requestPathPrefix = ".."): |
72 | def configureIndexContent (self, indexContent): | ||
72 | result = indexContent | 73 | result = indexContent |
73 | result = result.replace( '@request.path@', requestPathPrefix + '/' + self.settings['request.path'] ) | 74 | # result = result.replace( '@request.path@', requestPathPrefix + '/' + self.settings['request.path'] ) |
75 | result = result.replace( '@request.path@', self.settings['request.path'] ) | ||
76 | result = result.replace( '@dump.path@', self.settings['dump.path'] ) | ||
74 | result = result.replace( '@should.pay.toll@', self.settings['should.pay.toll'] ) | 77 | result = result.replace( '@should.pay.toll@', self.settings['should.pay.toll'] ) |
75 | 78 | ||
76 | return result | 79 | return result |
77 | 80 | ||
78 | 81 | ||
79 | def formatMAC (self, value): | 82 | def formatMAC (self, value): |
80 | x = iter(value) | 83 | x = iter(value) |
81 | return ' '.join([reduce(add, tup) for tup in izip(x, x, x, x)]) | 84 | return ' '.join([reduce(add, tup) for tup in izip(x, x, x, x)]) |
82 | 85 | ||
83 | 86 | ||
84 | def logChecksums (self, content, message): | 87 | def logChecksums (self, content, message): |
85 | md5Digest = self.formatMAC(hashlib.md5(content.encode('utf-8')).hexdigest()) | 88 | md5Digest = self.formatMAC(hashlib.md5(content.encode('utf-8')).hexdigest()) |
86 | shaDigest = self.formatMAC(hashlib.sha1(content.encode('utf-8')).hexdigest()) | 89 | shaDigest = self.formatMAC(hashlib.sha1(content.encode('utf-8')).hexdigest()) |
87 | sha256Digest= self.formatMAC(hashlib.sha256(content.encode('utf-8')).hexdigest()) | 90 | sha256Digest= self.formatMAC(hashlib.sha256(content.encode('utf-8')).hexdigest()) |
88 | print "-----" | 91 | print "-----" |
89 | print message + ": " + md5Digest + " (md5)" | 92 | print message + ": " + md5Digest + " (md5)" |
90 | print message + ": " + shaDigest + " (sha1)" | 93 | print message + ": " + shaDigest + " (sha1)" |
91 | print message + ": " + sha256Digest + " (sha256)" | 94 | print message + ": " + sha256Digest + " (sha256)" |
92 | print "=====" | 95 | print "=====" |
93 | 96 | ||
94 | 97 | ||
95 | def shouldCompileCode (self): | 98 | def shouldCompileCode (self): |
96 | return ('debug' in self.versions) or ('install' in self.versions) | 99 | return ('debug' in self.versions) or ('install' in self.versions) |
97 | 100 | ||