mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Merge branch 'develop'
This commit is contained in:
commit
fb29b6aad9
@ -1,3 +1,12 @@
|
||||
pywb 0.5.1 changelist
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
minor fixes:
|
||||
|
||||
* cdxindexer accepts unicode filenames, encodes via sys encoding
|
||||
|
||||
* SCRIPT_NAME now defaults to '' if not present
|
||||
|
||||
|
||||
pywb 0.5.0 changelist
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
PyWb 0.5.0
|
||||
PyWb 0.5.1
|
||||
==========
|
||||
|
||||
.. image:: https://travis-ci.org/ikreymer/pywb.png?branch=master
|
||||
|
@ -49,12 +49,13 @@ class ArchivalRouter(object):
|
||||
def parse_request(self, route, env, matcher, coll, request_uri,
|
||||
use_abs_prefix=False):
|
||||
matched_str = matcher.group(0)
|
||||
rel_prefix = env.get('SCRIPT_NAME', '') + '/'
|
||||
|
||||
if matched_str:
|
||||
rel_prefix = env['SCRIPT_NAME'] + '/' + matched_str + '/'
|
||||
rel_prefix += matched_str + '/'
|
||||
# remove the '/' + rel_prefix part of uri
|
||||
wb_url_str = request_uri[len(matched_str) + 2:]
|
||||
else:
|
||||
rel_prefix = env['SCRIPT_NAME'] + '/'
|
||||
# the request_uri is the wb_url, since no coll
|
||||
wb_url_str = request_uri[1:]
|
||||
|
||||
@ -157,7 +158,7 @@ class ReferRedirect:
|
||||
|
||||
path = ref_split.path
|
||||
|
||||
app_path = env['SCRIPT_NAME']
|
||||
app_path = env.get('SCRIPT_NAME', '')
|
||||
|
||||
if app_path:
|
||||
# must start with current app name, if not root
|
||||
|
@ -109,7 +109,6 @@ def cdx_filename(filename):
|
||||
|
||||
#=================================================================
|
||||
def write_multi_cdx_index(output, inputs, **options):
|
||||
|
||||
# write one cdx per dir
|
||||
if output != '-' and os.path.isdir(output):
|
||||
for fullpath, filename in iter_file_or_dir(inputs):
|
||||
@ -145,6 +144,9 @@ def write_multi_cdx_index(output, inputs, **options):
|
||||
def write_cdx_index(outfile, infile, filename, **options):
|
||||
writer_cls = options.get('writer_cls')
|
||||
|
||||
if type(filename) is unicode:
|
||||
filename = filename.encode(sys.getfilesystemencoding())
|
||||
|
||||
if writer_cls:
|
||||
pass
|
||||
elif options.get('sort'):
|
||||
|
@ -130,8 +130,8 @@ com,example)/?example=1 20140103030321 http://example.com?example=1 text/html 20
|
||||
org,iana)/domains/example 20140128051539 http://www.iana.org/domains/example text/html 302 JZ622UA23G5ZU6Y3XAKH4LINONUEICEG - - 577 2907 example.warc.gz
|
||||
4
|
||||
|
||||
# test writing to temp dir
|
||||
>>> cli_lines_with_dir(TEST_WARC_DIR + 'example.warc.gz')
|
||||
# test writing to temp dir, also use unicode filename
|
||||
>>> cli_lines_with_dir(unicode(TEST_WARC_DIR + 'example.warc.gz'))
|
||||
example.cdx
|
||||
com,example)/?example=1 20140103030321 http://example.com?example=1 text/html 200 B2LTWWPUOYAH7UIPQ7ZUPQ4VMBSVC36A - - 1043 333 example.warc.gz
|
||||
org,iana)/domains/example 20140128051539 http://www.iana.org/domains/example text/html 302 JZ622UA23G5ZU6Y3XAKH4LINONUEICEG - - 577 2907 example.warc.gz
|
||||
|
@ -67,8 +67,7 @@ class BaseContentView(object):
|
||||
# (not supported in proxy mode)
|
||||
if (self.is_frame_mode and wbrequest.wb_url and
|
||||
not wbrequest.wb_url.mod and
|
||||
not wbrequest.options['is_proxy'] and
|
||||
not wbrequest.options.get('is_timegate', False)):
|
||||
not wbrequest.options['is_proxy']):
|
||||
|
||||
embed_url = wbrequest.wb_url.to_str(mod=self._mp_mod)
|
||||
timestamp = datetime_to_timestamp(datetime.datetime.utcnow())
|
||||
|
Loading…
x
Reference in New Issue
Block a user