1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2024-11-14 19:09:03 +01:00
password-manager-mirror/scripts/builder/frontends/deltaBuilder.py
jokajak fab1d05127 Introduce new flask based python backend
This supports most functionality. Tested the following functionality:
* Create account
* Delete account
* Create a card
* Download offline copy (couldn't log in) - needs work
* Change passphrase
* One time password creation and use
2015-04-20 08:37:48 -04:00

65 lines
1.7 KiB
Python

from frontendBuilder import FrontendBuilder
#from scss import Scss
import os
import shutil
import main
import logging
class DeltaBuilder(FrontendBuilder):
def name(self):
return "/delta builder"
def projectResourceTypes (self):
return ['js', 'css']
# def copyStaticResources (self, targetFolder):
def copyResourcesToFolder (self, targetFolder):
#print "DELTA - copyResourcesToFolder"
resourcesToCopy = [
{'folder': 'properties', 'source': 'manifest.appcache', 'target': 'manifest.appcache'}
]
for resource in resourcesToCopy:
#print "copying resource: " + str(resource['source'])
content = self.loadFilesContent(resource['folder'], [resource['source']])
content = content.replace('@application.version@', self.repositoryVersion)
dst = self.absolutePathForTargetFile(targetFolder, '', resource['target'])
file = open(dst, 'w')
file.write(content.encode('utf-8'))
file.close()
def bookmarklet (self):
return ""
def preprocessCSS (self, targetFile):
from scss import Scss
logging.basicConfig()
scssVariables = {}
scssCompiler = Scss(
scss_vars = None,
scss_opts = {
'compress': True,
# 'debug_info': True,
},
scss_files = self.loadIndividualFilesContent('scss', self.settings['scss']),
# super_selector = None,
# live_errors = False,
# library = ALL_BUILTINS_LIBRARY,
search_paths = [os.path.join(self.absolutePathForSources(), 'scss')]
)
cssFileContent = scssCompiler.compile()
dst = targetFile
dst = os.path.join(os.path.dirname(dst), "_" + os.path.basename(dst))
main.createFolder(os.path.dirname(dst))
file = open(dst, 'w')
file.write(cssFileContent.encode('utf-8'))
file.close()