summaryrefslogtreecommitdiff
path: root/scripts
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2013-08-30 15:56:53 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2013-08-30 21:23:42 (UTC)
commit20bea94ab6b91c85b171dcf86baba0a64169d508 (patch) (side-by-side diff)
tree6e38e91498dcdb861620eba1e237d1026fe79cc5 /scripts
parentbde3c7b98523112ade9c5bbf7390c4ecb494cd2e (diff)
downloadclipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.zip
clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.gz
clipperz-20bea94ab6b91c85b171dcf86baba0a64169d508.tar.bz2
First release of /delta version
Diffstat (limited to 'scripts') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/builder/backendBuilder.py7
-rw-r--r--[-rwxr-xr-x]scripts/builder/backends/phpBuilder.py0
-rw-r--r--scripts/builder/frontendBuilder.py73
-rw-r--r--scripts/builder/frontends/betaBuilder.py3
-rw-r--r--scripts/builder/frontends/deltaBuilder.py16
-rw-r--r--scripts/builder/frontends/gammaBuilder.py3
-rw-r--r--scripts/builder/frontends/gamma_mobileBuilder.py3
-rwxr-xr-xscripts/proxy/main.py19
8 files changed, 60 insertions, 64 deletions
diff --git a/scripts/builder/backendBuilder.py b/scripts/builder/backendBuilder.py
index b4ee990..ad6595c 100755
--- a/scripts/builder/backendBuilder.py
+++ b/scripts/builder/backendBuilder.py
@@ -69,7 +69,10 @@ class BackendBuilder(object):
- def configureIndexContent (self, indexContent, requestPathPrefix = ".."):
+# def configureIndexContent (self, indexContent, requestPathPrefix = ".."):
+ def configureIndexContent (self, indexContent):
result = indexContent
- result = result.replace( '@request.path@', requestPathPrefix + '/' + self.settings['request.path'] )
+# result = result.replace( '@request.path@', requestPathPrefix + '/' + self.settings['request.path'] )
+ result = result.replace( '@request.path@', self.settings['request.path'] )
+ result = result.replace( '@dump.path@', self.settings['dump.path'] )
result = result.replace( '@should.pay.toll@', self.settings['should.pay.toll'] )
diff --git a/scripts/builder/backends/phpBuilder.py b/scripts/builder/backends/phpBuilder.py
index c928aa0..c928aa0 100755..100644
--- a/scripts/builder/backends/phpBuilder.py
+++ b/scripts/builder/backends/phpBuilder.py
diff --git a/scripts/builder/frontendBuilder.py b/scripts/builder/frontendBuilder.py
index e52c31e..b72179f 100644
--- a/scripts/builder/frontendBuilder.py
+++ b/scripts/builder/frontendBuilder.py
@@ -36,4 +36,6 @@ class FrontendBuilder(object):
raise NotImplementedError()
+ def projectResourceTypes (self):
+ raise NotImplementedError()
def copyStaticResources (self, targetFolder):
@@ -94,7 +96,9 @@ class FrontendBuilder(object):
def copyResourcesToFolder (self, targetFolder):
- self.copyResources(self.projectDir, targetFolder, 'css')
- self.copyResources(self.projectDir, targetFolder, 'js')
- self.copyResources(self.projectDir, targetFolder, 'images')
+# self.copyResources(self.projectDir, targetFolder, 'css')
+# self.copyResources(self.projectDir, targetFolder, 'js')
+# self.copyResources(self.projectDir, targetFolder, 'images')
+ for resoureceType in self.projectResourceTypes():
+ self.copyResources(self.projectDir, targetFolder, resoureceType)
self.copyStaticResources(targetFolder)
@@ -244,53 +248,6 @@ class FrontendBuilder(object):
result = result.strip()
result = 'javascript:' + result
-
-# replacers = [
-# ('aForm', '_1' ),
-# ('inputFields', '_2' ),
-# ('passwordFieldsFound', '_3' ),
-# ('aDocument', '_6' ),
-# ('aLevel', '_7' ),
-# # ('result', '_8' ),
-# ('documentForms', '_9' ),
-# ('iFrames', '_c' ),
-# ('anInputElement', '_d' ),
-# ('options', '_f' ),
-# ('option', '_12'),
-# ('aLoginForm', '_13'),
-# # ('action', '_17'),
-# ('radioValues', '_18'),
-# ('radioValueName', '_19'),
-# ('inputElement', '_1a'),
-# ('elementValues', '_1b'),
-# ('radioValue', '_1c'),
-# ('values', '_1d'),
-# ('objtype', '_21'),
-# ('useKey', '_27'),
-# ('bookmarkletDiv', '_28'),
-# ('someParameters', '_29'),
-# ('anException', '_2a'),
-# ('newDiv', '_2b'),
-# ('base_url', '_2c'),
-# ('help_url', '_2d'),
-# ('logo_image_url', '_2e'),
-# ('background_image_url','_2f'),
-# ('close_image_url', '_30'),
-# # ('bookmarklet_textarea','_31'),
-# ('innerHTML', '_32'),
-# ]
-# for replacer in replacers:
-# result = re.sub('([^\.])' + replacer[0], '\\1' + replacer[1], result)
-
-# replacers = [
-# ('headNode', '_1' ),
-# ('clipperzScriptNode', '_2' ),
-# ]
-# for replacer in replacers:
-# result = re.sub('([^\.])' + replacer[0], '\\1' + replacer[1], result)
-
-# result = re.sub(';', ';\n', result)
return result
-
@@ -389,7 +346,9 @@ class FrontendBuilder(object):
copyright = self.assembleCopyrightHeader()
css = self.cssTagsForFiles('./css', self.filterFiles(self.settings['css']))
- js = self.scriptTagForContent(self.bookmarklet()) + \
- '\n' + \
- self.scriptTagsForFiles('./js', self.filterFiles(self.settings['js']))
+ js = self.scriptTagForContent(
+ self.bookmarklet()) + \
+ '\n' + \
+ self.scriptTagsForFiles('./js', self.filterFiles(self.settings['js'])
+ )
jsLoadMode = 'LINKED'
@@ -397,7 +356,9 @@ class FrontendBuilder(object):
copyright = ""
css = self.cssTagsForFiles('file://' + str(os.path.join(self.absolutePathForSources(), 'css')), self.filterFiles(self.settings['css']))
- js = self.scriptTagForContent(self.bookmarklet()) + \
- '\n' + \
- self.scriptTagsForFiles('file://' + str(os.path.join(self.absolutePathForSources(), 'js')), self.filterFiles(self.settings['js']))
+ js = self.scriptTagForContent(
+ self.bookmarklet()) + \
+ '\n' + \
+ self.scriptTagsForFiles('file://' + str(os.path.join(self.absolutePathForSources(), 'js')), self.filterFiles(self.settings['js'])
+ )
jsLoadMode = 'LINKED'
versionType = 'development'
diff --git a/scripts/builder/frontends/betaBuilder.py b/scripts/builder/frontends/betaBuilder.py
index c5a3e76..9b32404 100644
--- a/scripts/builder/frontends/betaBuilder.py
+++ b/scripts/builder/frontends/betaBuilder.py
@@ -7,4 +7,7 @@ class BetaBuilder(FrontendBuilder):
return "/beta builder"
+ def projectResourceTypes (self):
+ return ['js', 'css', 'images']
+
def copyStaticResources (self, targetFolder):
for file in self.filterFiles(self.settings['staticResources']):
diff --git a/scripts/builder/frontends/deltaBuilder.py b/scripts/builder/frontends/deltaBuilder.py
new file mode 100644
index 0000000..a341a83
--- a/dev/null
+++ b/scripts/builder/frontends/deltaBuilder.py
@@ -0,0 +1,16 @@
+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
+
+ def bookmarklet (self):
+ return "" \ No newline at end of file
diff --git a/scripts/builder/frontends/gammaBuilder.py b/scripts/builder/frontends/gammaBuilder.py
index a6ecb7b..c56fb1b 100644
--- a/scripts/builder/frontends/gammaBuilder.py
+++ b/scripts/builder/frontends/gammaBuilder.py
@@ -7,4 +7,7 @@ class GammaBuilder(FrontendBuilder):
return "/gamma builder"
+ def projectResourceTypes (self):
+ return ['js', 'css', 'images']
+
def copyStaticResources (self, targetFolder):
resourcesToCopy = [
diff --git a/scripts/builder/frontends/gamma_mobileBuilder.py b/scripts/builder/frontends/gamma_mobileBuilder.py
index f2e80c9..677a2b0 100644
--- a/scripts/builder/frontends/gamma_mobileBuilder.py
+++ b/scripts/builder/frontends/gamma_mobileBuilder.py
@@ -6,4 +6,7 @@ class Gamma_MobileBuilder(FrontendBuilder):
return "/gamma.mobile builder"
+ def projectResourceTypes (self):
+ return ['js', 'css', 'images']
+
def copyStaticResources (self, targetFolder):
pass
diff --git a/scripts/proxy/main.py b/scripts/proxy/main.py
index 107ba16..8ce4989 100755
--- a/scripts/proxy/main.py
+++ b/scripts/proxy/main.py
@@ -28,5 +28,8 @@ class ClipperzTestSite(server.Site):
def getResourceFor(self, request):
- if request.uri.startswith('/json') or request.uri.startswith('/dump'):
+ uri = request.uri
+ uri = uri.split("?", 1)[0]
+ uri = uri.split("#", 1)[0]
+ if uri.startswith('/json') or uri.startswith('/dump'):
request.site = self
request.sitepath = copy.copy(request.prepath)
@@ -34,5 +37,5 @@ class ClipperzTestSite(server.Site):
else:
- pathParts = request.uri.split('/')
+ pathParts = uri.split('/')
version = pathParts[1]
@@ -41,5 +44,9 @@ class ClipperzTestSite(server.Site):
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)
else:
# http://homer.local:8888/beta/css/clipperz/images/loginInfoBackground.png
@@ -55,5 +62,5 @@ class ClipperzTestSite(server.Site):
basePath = projectBaseDir() + '/frontend'
if resourceType == 'images':
- fileExtension = os.path.splitext(request.uri)[1]
+ fileExtension = os.path.splitext(uri)[1]
if fileExtension == '.png':
contentType = 'image/png'
@@ -76,5 +83,5 @@ class ClipperzTestSite(server.Site):
contentType = 'text/html'
- absoluteFilePath = basePath + request.uri
+ absoluteFilePath = basePath + uri
result = static.File(absoluteFilePath, contentType)
@@ -86,5 +93,5 @@ class ClipperzTestSite(server.Site):
def main ():
- site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8084, '/java-backend'))
+ site = ClipperzTestSite(proxy.ReverseProxyResource('localhost', 8080, '/java-backend'))
reactor.listenTCP(8888, site)
reactor.run()