Permalink
Browse files

static paths: ensure consistent renaming of static/default -> static/…

…__pywb for bundled static path
  • Loading branch information...
1 parent 5b4d12e commit ec7a29a3bad07cb3b1b7c4d369559a6cbd696b51 @ikreymer committed Mar 23, 2015
Showing with 13 additions and 13 deletions.
  1. +2 −2 config.yaml
  2. +8 −8 pywb/rewrite/test/test_rewrite_live.py
  3. +1 −1 pywb/webapp/live_rewrite_handler.py
  4. +1 −1 pywb/webapp/views.py
  5. +1 −1 tests/test_config.yaml
View
@@ -106,9 +106,9 @@ enable_http_proxy: true
# List of route names:
# <route>: <package or file path>
-# default route static/default for pywb defaults
+# default route static/__pywb for pywb bundled static files
#static_routes:
-# static/default: pywb/static/
+# static/__pywb: pywb/static/
# enable cdx server api for querying cdx directly (experimental)
enable_cdx_api: true
@@ -14,7 +14,7 @@
def head_insert_func(rule, cdx):
if rule.js_rewrite_location != 'urls':
- return '<script src="/static/default/wombat.js"> </script>'
+ return '<script src="/static/__pywb/wombat.js"> </script>'
else:
return ''
@@ -74,7 +74,7 @@ def test_local_1():
'com,example,test)/')
# wombat insert added
- assert '<head><script src="/static/default/wombat.js"> </script>' in buff, buff
+ assert '<head><script src="/static/__pywb/wombat.js"> </script>' in buff, buff
# JS location and JS link rewritten
assert 'window.WB_wombat_location = "/pywb/20131226101010/http:\/\/example.com/dynamic_page.html"' in buff
@@ -90,7 +90,7 @@ def test_local_no_head():
'com,example,test)/')
# wombat insert added
- assert '<script src="/static/default/wombat.js"> </script>' in buff
+ assert '<script src="/static/__pywb/wombat.js"> </script>' in buff
# location rewritten
assert 'window.WB_wombat_location = "/other.html"' in buff
@@ -105,7 +105,7 @@ def test_local_no_head_banner_only():
'com,example,test)/')
# wombat insert added
- assert '<script src="/static/default/wombat.js"> </script>' in buff
+ assert '<script src="/static/__pywb/wombat.js"> </script>' in buff
# location NOT rewritten
assert 'window.location = "/other.html"' in buff
@@ -120,7 +120,7 @@ def test_local_banner_only_no_rewrite():
'com,example,test)/')
# wombat insert added
- assert '<head><script src="/static/default/wombat.js"> </script>' in buff
+ assert '<head><script src="/static/__pywb/wombat.js"> </script>' in buff
# JS location NOT rewritten, JS link NOT rewritten
assert 'window.location = "http:\/\/example.com/dynamic_page.html"' in buff, buff
@@ -135,7 +135,7 @@ def test_local_2_link_only_rewrite():
'example,example,test)/nolocation_rewrite')
# no wombat insert
- assert '<head><script src="/static/default/wombat.js"> </script>' not in buff
+ assert '<head><script src="/static/__pywb/wombat.js"> </script>' not in buff
# JS location NOT rewritten, JS link rewritten
assert 'window.location = "/pywb/20131226101010/http:\/\/example.com/dynamic_page.html"' in buff
@@ -151,7 +151,7 @@ def test_local_2_js_loc_only_rewrite():
'example,example,test,loconly)/')
# wombat insert added
- assert '<script src="/static/default/wombat.js"> </script>' in buff
+ assert '<script src="/static/__pywb/wombat.js"> </script>' in buff
# JS location rewritten, JS link NOT rewritten
assert 'window.WB_wombat_location = "http:\/\/example.com/dynamic_page.html"' in buff
@@ -166,7 +166,7 @@ def test_local_2_no_rewrite():
'example,example,test,norewrite)/')
# wombat insert added
- assert '<script src="/static/default/wombat.js"> </script>' in buff
+ assert '<script src="/static/__pywb/wombat.js"> </script>' in buff
# JS location NOT rewritten, JS link NOT rewritten
assert 'window.location = "http:\/\/example.com/dynamic_page.html"' in buff
@@ -286,7 +286,7 @@ def extract_info(self, url):
#=================================================================
def create_live_rewriter_app(config={}):
routes = [Route('rewrite', RewriteHandler(config)),
- Route('static/default', StaticHandler('pywb/static/'))
+ Route('static/__pywb', StaticHandler('pywb/static/'))
]
return ArchivalRouter(routes, hostpaths=['http://localhost:8080'])
@@ -67,7 +67,7 @@ def tojson(obj):
#=================================================================
class J2TemplateView(object):
- env_globals = {'static_path': 'static/default',
+ env_globals = {'static_path': 'static/__pywb',
'packages': ['pywb']}
def __init__(self, filename):
@@ -107,7 +107,7 @@ absoulte_paths: true
# <route>: <package or file path>
static_routes:
static/test/route: pywb/static/
- static/default: pywb/static/
+ static/__pywb: pywb/static/
# Enable simple http proxy mode
enable_http_proxy: true

0 comments on commit ec7a29a

Please sign in to comment.