summaryrefslogtreecommitdiff
path: root/scripts
authorJosh <jokajak@gmail.com>2012-03-17 19:29:33 (UTC)
committer Josh <jokajak@gmail.com>2012-03-17 19:29:33 (UTC)
commit0e396afdc4aa9ec8734ba48f90e9fefbad3b2b33 (patch) (side-by-side diff)
tree2ace8ec32d24c1d34b4578fe9297c4e4b4b97720 /scripts
parentff33328861685c1a2d5f9b729a2b3595509c38ee (diff)
parent6f7ead0446aae6dd9f40b183e402b059a33d0517 (diff)
downloadclipperz-0e396afdc4aa9ec8734ba48f90e9fefbad3b2b33.zip
clipperz-0e396afdc4aa9ec8734ba48f90e9fefbad3b2b33.tar.gz
clipperz-0e396afdc4aa9ec8734ba48f90e9fefbad3b2b33.tar.bz2
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'scripts') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/builder/backendBuilder.py21
-rw-r--r--scripts/builder/frontendBuilder.py5
-rw-r--r--scripts/builder/repository.py18
3 files changed, 31 insertions, 13 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
@@ -86,33 +86,46 @@ class BackendBuilder(object):
def run (self):
print self.name() + " - RUN"
if self.shouldCompileCode():
self.compileCode()
for frontend in self.frontends:
+ if (frontend.module == frontend.submodule):
+ submoduleExtension = ''
+ else:
+ submoduleExtension = '.' + frontend.submodule
+
main.createFolder(os.path.join(self.frontEndTempFolder(), frontend.module))
if 'debug' in self.versions:
frontend.copyResourcesToFolder(self.frontEndTempFolder())
index = self.configureIndexContent(frontend.assemble(assemblyMode='DEBUG', versionType='DEBUG'))
- self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug.html'), index)
+ self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index_debug' + submoduleExtension + '.html'), index)
if 'install' in self.versions:
index = self.configureIndexContent(frontend.assemble())
- self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index.html'), index)
+ self.writeToFolder(self.frontEndTempFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)
- self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index.html checksum")
+ self.logChecksums(index, "[" + self.name() + " - " + frontend.module + "] index" + submoduleExtension + ".html checksum")
self.createPackage()
if 'development' in self.versions:
for frontend in self.frontends:
+ if (frontend.module == frontend.submodule):
+ submoduleExtension = ''
+ else:
+ submoduleExtension = '.' + frontend.submodule
+
+ print "FRONTEND module: " + frontend.module
+ print "FRONTEND submodule: " + frontend.submodule
+
main.createFolder(os.path.join(self.developmentTargetFolder(), frontend.module))
index = self.configureIndexContent(frontend.assemble(assemblyMode='DEVELOPMENT', versionType='DEBUG'), self.settings['development.settings']['url'])
- self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index.html'), index)
+ self.writeToFolder(self.developmentTargetFolder(), os.path.join(frontend.module, 'index' + submoduleExtension + '.html'), index)
#===================================================================
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
@@ -83,17 +83,18 @@ class FrontendBuilder(object):
fileHandler.close()
return result
def template (self):
processedFile = 'html_template'
if not self.processedFiles.has_key(processedFile):
- self.processedFiles[processedFile] = self.loadFilesContent('html', ['index_template.html'])
+ # self.processedFiles[processedFile] = self.loadFilesContent('html', ['index_template.html'])
+ self.processedFiles[processedFile] = self.loadFilesContent('html', [self.settings['html.template']])
return self.processedFiles[processedFile]
def cssminCompressor (self, css):
# package found here:
# - http://stackoverflow.com/questions/222581/python-script-for-minifying-css/2396777#2396777
# actual downloaded version: http://pypi.python.org/pypi/cssmin/0.1.4
@@ -314,17 +315,17 @@ class FrontendBuilder(object):
def cssTagForContent (self, content):
return '<style type="text/css">' + content + '</style>'
def scriptTagsForFiles (self, basePath, files):
#<script type='text/javascript' src='./js/src/bookmarklet.js'></script>
- return '\n'.join(map(lambda file: '<script type="text/javascript" src="' + basePath + '/' + file + '"></script>', files))
+ return '\n'.join(map(lambda file: '<script type="text/javascript" src="' + basePath + '/' + file + '" charset="utf-8"></script>', files))
def scriptTagForContent (self, content):
return '<script>' + content + '</script>'
def assembleVersion (self, pageTitle, copyright, css, js, jsLoadMode, version, versionType):
cacheKey = version + "-" + versionType
diff --git a/scripts/builder/repository.py b/scripts/builder/repository.py
index 0efa10b..0045de7 100644
--- a/scripts/builder/repository.py
+++ b/scripts/builder/repository.py
@@ -1,25 +1,28 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
def repositoryWithPath (path):
try:
- from git import Repo
-
- repo = Repo(path)
- result = GitRepository(repo, path)
- except ImportError:
- print "Failed to import git, please install http://gitorious.org/git-python"
- except:
from mercurial import ui, hg
repo = hg.repository(ui.ui(), path)
result = HgRepository(repo, path)
+ except:
+ try:
+ from git import Repo
+
+ repo = Repo(path)
+ result = GitRepository(repo, path)
+ except ImportError, exception:
+ print "Failed to import git, please install http://gitorious.org/git-python"
+ raise exception
+
return result
#===================================================================
class Repository(object):
@@ -45,16 +48,17 @@ class Repository(object):
# print "VERSION: " + result
return result
#===================================================================
class GitRepository(Repository):
+ # http://gitorious.org/git-python
def revision (self):
return self.repository.head.commit.hexsha
def areTherePendingChanges (self):
return self.repository.is_dirty()