summaryrefslogtreecommitdiff
path: root/scripts
Side-by-side diff
Diffstat (limited to 'scripts') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/builder/frontends/deltaBuilder.py9
-rwxr-xr-xscripts/proxy/main.py5
2 files changed, 13 insertions, 1 deletions
diff --git a/scripts/builder/frontends/deltaBuilder.py b/scripts/builder/frontends/deltaBuilder.py
index a341a83..17ac941 100644
--- a/scripts/builder/frontends/deltaBuilder.py
+++ b/scripts/builder/frontends/deltaBuilder.py
@@ -1,16 +1,23 @@
from frontendBuilder import FrontendBuilder
import shutil
class DeltaBuilder(FrontendBuilder):
def name(self):
return "/delta builder"
def projectResourceTypes (self):
return ['js', 'css']
def copyStaticResources (self, targetFolder):
- pass
+ resourcesToCopy = [
+ {'folder': 'properties', 'source': 'manifest.appcache', 'target': 'manifest.appcache'}
+ ]
+
+ for resource in resourcesToCopy:
+ src = self.absolutePathForSourceFile(resource['folder'], resource['source'])
+ dst = self.absolutePathForTargetFile(targetFolder, '', resource['target'])
+ shutil.copy2(src, dst)
def bookmarklet (self):
return "" \ No newline at end of file
diff --git a/scripts/proxy/main.py b/scripts/proxy/main.py
index 8ce4989..58a4d7f 100755
--- a/scripts/proxy/main.py
+++ b/scripts/proxy/main.py
@@ -35,32 +35,36 @@ class ClipperzTestSite(server.Site):
request.sitepath = copy.copy(request.prepath)
result = resource.getChildForRequest(self.resource, request)
else:
pathParts = uri.split('/')
version = pathParts[1]
if pathParts[2].startswith('index.'):
contentType = 'text/html'
absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
result = static.File(absoluteFilePath, contentType)
elif pathParts[2].endswith('.webapp'):
contentType = 'application/x-web-app-manifest+json'
# absoluteFilePath = os.path.join(projectTargetDir(), 'dev', version, pathParts[2])
absoluteFilePath = os.path.join(projectBaseDir(), 'frontend', version, 'properties', pathParts[2])
result = static.File(absoluteFilePath, contentType)
+ elif pathParts[2].endswith('.appcache'):
+ contentType = 'text/cache-manifest'
+ absoluteFilePath = os.path.join(projectBaseDir(), 'frontend', version, 'properties', pathParts[2])
+ result = static.File(absoluteFilePath, contentType)
else:
# http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png
# pathParts: ['', 'beta', 'css', 'clipperz', 'images', 'loginInfoBackground.png']
try:
imagePathIndex = pathParts.index('images')
resourceType = 'images'
for _ in range(2, imagePathIndex):
del pathParts[2]
except:
resourceType = pathParts[2]
basePath = projectBaseDir() + '/frontend'
if resourceType == 'images':
fileExtension = os.path.splitext(uri)[1]
if fileExtension == '.png':
contentType = 'image/png'
@@ -80,23 +84,24 @@ class ClipperzTestSite(server.Site):
elif resourceType == 'js':
contentType = 'text/javascript'
else:
contentType = 'text/html'
absoluteFilePath = basePath + uri
result = static.File(absoluteFilePath, contentType)
return result
def main ():
site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8080, '/java-backend'))
+# site = ClipperzTestSite(proxy.ReverseProxyResource('www.clipperz.com', 443, '/'))
reactor.listenTCP(8888, site)
reactor.run()
if __name__ == "__main__":
main()