1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2024-11-13 09:19:01 +01:00

Merge pull request #31 from gcsolaroli/master

Updated build scripts
This commit is contained in:
Giulio Cesare Solaroli 2012-03-17 07:43:30 -07:00
commit 58ec03cc3d
4 changed files with 29 additions and 13 deletions

View File

@ -1,9 +1,9 @@
{
"request.path": "index.php",
"should.pay.toll": "false"
"should.pay.toll": "false",
"development.settings": {
"url": "http://localhost/php/clipperz"
}
}
}

View File

@ -91,28 +91,41 @@ class BackendBuilder(object):
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)
#===================================================================

View File

@ -88,7 +88,8 @@ class FrontendBuilder(object):
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]
@ -319,7 +320,7 @@ class FrontendBuilder(object):
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):

View File

@ -4,11 +4,13 @@
def repositoryWithPath (path):
try:
from dulwich.repo import Repo
from git import Repo
repo = Repo(path)
result = GitRepository(repo, path)
except:
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)
@ -50,11 +52,11 @@ class Repository(object):
class GitRepository(Repository):
def revision (self):
return repository.refs['HEAD']
return self.repository.head.commit.hexsha
def areTherePendingChanges (self):
return repository.is_dirty()
return self.repository.is_dirty()
#===================================================================