default values for dedup_min_text_size et al

because they may be missing in case warcprox is used as a library
This commit is contained in:
Noah Levitt 2018-05-15 11:22:10 -07:00
parent 15830fc5a2
commit af863c6dba
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ except:
setuptools.setup(
name='warcprox',
version='2.4b2.dev170',
version='2.4b2.dev171',
description='WARC writing MITM HTTP/S proxy',
url='https://github.com/internetarchive/warcprox',
author='Noah Levitt',

View File

@ -39,9 +39,9 @@ urllib3.disable_warnings()
class DedupableMixin(object):
def __init__(self, options=warcprox.Options()):
self.min_text_size = options.dedup_min_text_size
self.min_binary_size = options.dedup_min_binary_size
self.dedup_only_with_bucket = options.dedup_only_with_bucket
self.min_text_size = options.dedup_min_text_size or 0
self.min_binary_size = options.dedup_min_binary_size or 0
self.dedup_only_with_bucket = options.dedup_only_with_bucket or False
def should_dedup(self, recorded_url):
"""Check if we should try to run dedup on resource based on payload