-rw-r--r-- | scripts/builder/backendBuilder.py | 21 | ||||
-rw-r--r-- | scripts/builder/frontendBuilder.py | 5 | ||||
-rw-r--r-- | scripts/builder/repository.py | 12 |
3 files changed, 27 insertions, 11 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py index 3e61955..5b91678 100644 --- a/scripts/builder/backendBuilder.py +++ b/scripts/builder/backendBuilder.py | |||
@@ -90,29 +90,42 @@ class BackendBuilder(object): | |||
90 | if self.shouldCompileCode(): | 90 | if self.shouldCompileCode(): |
91 | self.compileCode() | 91 | self.compileCode() |
92 | 92 | ||
93 | for frontend in self.frontends: | 93 | for frontend in self.frontends: |
94 | if (frontend.module == frontend.submodule): | ||
95 | submoduleExtension = '' | ||
96 | else: | ||
97 | submoduleExtension = '.' + frontend.submodule | ||
98 | |||
94 | main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) | 99 | main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module)) |
95 | 100 | ||
96 | if 'debug' in self.versions: | 101 | if 'debug' in self.versions: |
97 | frontend.copyResourcesToFolder(self.frontEndTempFolder()) | 102 | frontend.copyResourcesToFolder(self.frontEndTempFolder()) |
98 | 103 | ||
99 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG')) | 104 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG')) |
100 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug.html'), index) | 105 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index) |
101 | 106 | ||
102 | if 'install' in self.versions: | 107 | if 'install' in self.versions: |
103 | index = self.configureIndexContent(frontend.assemble()) | 108 | index = self.configureIndexContent(frontend.assemble()) |
104 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index.html'), index) | 109 | self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) |
105 | 110 | ||
106 | self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index.html checksum") | 111 | self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum") |
107 | 112 | ||
108 | self.createPackage() | 113 | self.createPackage() |
109 | 114 | ||
110 | if 'development' in self.versions: | 115 | if 'development' in self.versions: |
111 | for frontend in self.frontends: | 116 | for frontend in self.frontends: |
117 | if (frontend.module == frontend.submodule): | ||
118 | submoduleExtension = '' | ||
119 | else: | ||
120 | submoduleExtension = '.' + frontend.submodule | ||
121 | |||
122 | print "FRONTEND module: " + frontend.module | ||
123 | print "FRONTEND submodule: " + frontend.submodule | ||
124 | |||
112 | main.createFolder(os.path.join(self.developmentTargetFolder(), frontend.module)) | 125 | main.createFolder(os.path.join(self.developmentTargetFolder(), frontend.module)) |
113 | 126 | ||
114 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEVELOPMENT', versionType='DEBUG'), self.settings['development.settings']['url']) | 127 | index = self.configureIndexContent(frontend.assemble(assemblyMode='DEVELOPMENT', versionType='DEBUG'), self.settings['development.settings']['url']) |
115 | self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index.html'), index) | 128 | self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index) |
116 | 129 | ||
117 | 130 | ||
118 | #=================================================================== | 131 | #=================================================================== |
diff --git a/scripts/builder/frontendBuilder.py b/scripts/builder/frontendBuilder.py index dae837b..1f0f92f 100644 --- a/scripts/builder/frontendBuilder.py +++ b/scripts/builder/frontendBuilder.py | |||
@@ -87,9 +87,10 @@ class FrontendBuilder(object): | |||
87 | 87 | ||
88 | def template (self): | 88 | def template (self): |
89 | processedFile = 'html_template' | 89 | processedFile = 'html_template' |
90 | if not self.processedFiles.has_key(processedFile): | 90 | if not self.processedFiles.has_key(processedFile): |
91 | self.processedFiles[processedFile] = self.loadFilesContent('html', ['index_template.html']) | 91 | #self.processedFiles[processedFile] = self.loadFilesContent('html', ['index_template.html']) |
92 | self.processedFiles[processedFile] = self.loadFilesContent('html', [self.settings['html.template']]) | ||
92 | 93 | ||
93 | return self.processedFiles[processedFile] | 94 | return self.processedFiles[processedFile] |
94 | 95 | ||
95 | 96 | ||
@@ -318,9 +319,9 @@ class FrontendBuilder(object): | |||
318 | 319 | ||
319 | 320 | ||
320 | def scriptTagsForFiles (self, basePath, files): | 321 | def scriptTagsForFiles (self, basePath, files): |
321 | #<script type='text/javascript' src='./js/src/bookmarklet.js'></script> | 322 | #<script type='text/javascript' src='./js/src/bookmarklet.js'></script> |
322 | return '\n'.join(map(lambda file: '<script type="text/javascript" src="' + basePath + '/' + file + '"></script>', files)) | 323 | return '\n'.join(map(lambda file: '<script type="text/javascript" src="' + basePath + '/' + file + '" charset="utf-8"></script>', files)) |
323 | 324 | ||
324 | 325 | ||
325 | def scriptTagForContent (self, content): | 326 | def scriptTagForContent (self, content): |
326 | return '<script>' + content + '</script>' | 327 | return '<script>' + content + '</script>' |
diff --git a/scripts/builder/repository.py b/scripts/builder/repository.py index 89db9a5..f8528c2 100644 --- a/scripts/builder/repository.py +++ b/scripts/builder/repository.py | |||
@@ -3,13 +3,15 @@ | |||
3 | 3 | ||
4 | 4 | ||
5 | def repositoryWithPath (path): | 5 | def repositoryWithPath (path): |
6 | try: | 6 | try: |
7 | from dulwich.repo import Repo | 7 | from git import Repo |
8 | 8 | ||
9 | repo = Repo(path) | 9 | repo = Repo(path) |
10 | result = GitRepository(repo, path) | 10 | result = GitRepository(repo, path) |
11 | except: | 11 | except ImportError: |
12 | print "Failed to import git, please install http://gitorious.org/git-python" | ||
13 | #except: | ||
12 | from mercurial import ui, hg | 14 | from mercurial import ui, hg |
13 | 15 | ||
14 | repo = hg.repository(ui.ui(), path) | 16 | repo = hg.repository(ui.ui(), path) |
15 | result = HgRepository(repo, path) | 17 | result = HgRepository(repo, path) |
@@ -49,13 +51,13 @@ class Repository(object): | |||
49 | 51 | ||
50 | class GitRepository(Repository): | 52 | class GitRepository(Repository): |
51 | 53 | ||
52 | def revision (self): | 54 | def revision (self): |
53 | return repository.refs['HEAD'] | 55 | return self.repository.head.commit.hexsha |
54 | 56 | ||
55 | 57 | ||
56 | def areTherePendingChanges (self): | 58 | def areTherePendingChanges (self): |
57 | return repository.is_dirty() | 59 | return self.repository.is_dirty() |
58 | 60 | ||
59 | 61 | ||
60 | #=================================================================== | 62 | #=================================================================== |
61 | 63 | ||