mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +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
|
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
|
.. 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,
|
def parse_request(self, route, env, matcher, coll, request_uri,
|
||||||
use_abs_prefix=False):
|
use_abs_prefix=False):
|
||||||
matched_str = matcher.group(0)
|
matched_str = matcher.group(0)
|
||||||
|
rel_prefix = env.get('SCRIPT_NAME', '') + '/'
|
||||||
|
|
||||||
if matched_str:
|
if matched_str:
|
||||||
rel_prefix = env['SCRIPT_NAME'] + '/' + matched_str + '/'
|
rel_prefix += matched_str + '/'
|
||||||
# remove the '/' + rel_prefix part of uri
|
# remove the '/' + rel_prefix part of uri
|
||||||
wb_url_str = request_uri[len(matched_str) + 2:]
|
wb_url_str = request_uri[len(matched_str) + 2:]
|
||||||
else:
|
else:
|
||||||
rel_prefix = env['SCRIPT_NAME'] + '/'
|
|
||||||
# the request_uri is the wb_url, since no coll
|
# the request_uri is the wb_url, since no coll
|
||||||
wb_url_str = request_uri[1:]
|
wb_url_str = request_uri[1:]
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ class ReferRedirect:
|
|||||||
|
|
||||||
path = ref_split.path
|
path = ref_split.path
|
||||||
|
|
||||||
app_path = env['SCRIPT_NAME']
|
app_path = env.get('SCRIPT_NAME', '')
|
||||||
|
|
||||||
if app_path:
|
if app_path:
|
||||||
# must start with current app name, if not root
|
# 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):
|
def write_multi_cdx_index(output, inputs, **options):
|
||||||
|
|
||||||
# write one cdx per dir
|
# write one cdx per dir
|
||||||
if output != '-' and os.path.isdir(output):
|
if output != '-' and os.path.isdir(output):
|
||||||
for fullpath, filename in iter_file_or_dir(inputs):
|
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):
|
def write_cdx_index(outfile, infile, filename, **options):
|
||||||
writer_cls = options.get('writer_cls')
|
writer_cls = options.get('writer_cls')
|
||||||
|
|
||||||
|
if type(filename) is unicode:
|
||||||
|
filename = filename.encode(sys.getfilesystemencoding())
|
||||||
|
|
||||||
if writer_cls:
|
if writer_cls:
|
||||||
pass
|
pass
|
||||||
elif options.get('sort'):
|
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
|
org,iana)/domains/example 20140128051539 http://www.iana.org/domains/example text/html 302 JZ622UA23G5ZU6Y3XAKH4LINONUEICEG - - 577 2907 example.warc.gz
|
||||||
4
|
4
|
||||||
|
|
||||||
# test writing to temp dir
|
# test writing to temp dir, also use unicode filename
|
||||||
>>> cli_lines_with_dir(TEST_WARC_DIR + 'example.warc.gz')
|
>>> cli_lines_with_dir(unicode(TEST_WARC_DIR + 'example.warc.gz'))
|
||||||
example.cdx
|
example.cdx
|
||||||
com,example)/?example=1 20140103030321 http://example.com?example=1 text/html 200 B2LTWWPUOYAH7UIPQ7ZUPQ4VMBSVC36A - - 1043 333 example.warc.gz
|
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
|
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)
|
# (not supported in proxy mode)
|
||||||
if (self.is_frame_mode and wbrequest.wb_url and
|
if (self.is_frame_mode and wbrequest.wb_url and
|
||||||
not wbrequest.wb_url.mod and
|
not wbrequest.wb_url.mod and
|
||||||
not wbrequest.options['is_proxy'] and
|
not wbrequest.options['is_proxy']):
|
||||||
not wbrequest.options.get('is_timegate', False)):
|
|
||||||
|
|
||||||
embed_url = wbrequest.wb_url.to_str(mod=self._mp_mod)
|
embed_url = wbrequest.wb_url.to_str(mod=self._mp_mod)
|
||||||
timestamp = datetime_to_timestamp(datetime.datetime.utcnow())
|
timestamp = datetime_to_timestamp(datetime.datetime.utcnow())
|
||||||
|
2
setup.py
2
setup.py
@ -34,7 +34,7 @@ class PyTest(TestCommand):
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='pywb',
|
name='pywb',
|
||||||
version='0.5.0',
|
version='0.5.1',
|
||||||
url='https://github.com/ikreymer/pywb',
|
url='https://github.com/ikreymer/pywb',
|
||||||
author='Ilya Kreymer',
|
author='Ilya Kreymer',
|
||||||
author_email='ikreymer@gmail.com',
|
author_email='ikreymer@gmail.com',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user