Default to None

This commit is contained in:
Shawn Grigson 2023-09-06 11:26:02 -05:00
parent 6f960aefec
commit b86f7cd0e4
1 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,7 @@ def fetch_from_instances(sources: dict,
def merge_blocklists(blocklists: list[Blocklist], mergeplan: str='max', def merge_blocklists(blocklists: list[Blocklist], mergeplan: str='max',
threshold: int=0, threshold: int=0,
threshold_type: str='count', threshold_type: str='count',
save_block_audit_file: str='') -> Blocklist: save_block_audit_file: str=None) -> Blocklist:
"""Merge fetched remote blocklists into a bulk update """Merge fetched remote blocklists into a bulk update
@param blocklists: A dict of lists of DomainBlocks, keyed by source. @param blocklists: A dict of lists of DomainBlocks, keyed by source.
Each value is a list of DomainBlocks Each value is a list of DomainBlocks
@ -242,7 +242,7 @@ def merge_blocklists(blocklists: list[Blocklist], mergeplan: str='max',
block = apply_mergeplan(block, newblock, mergeplan) block = apply_mergeplan(block, newblock, mergeplan)
merged.blocks[block.domain] = block merged.blocks[block.domain] = block
if len(save_block_audit_file) > 0: if save_block_audit_file:
blockdata:BlockAudit = { blockdata:BlockAudit = {
'domain': domain, 'domain': domain,
'count': domain_matches_count, 'count': domain_matches_count,
@ -250,7 +250,7 @@ def merge_blocklists(blocklists: list[Blocklist], mergeplan: str='max',
} }
audit.blocks[domain] = blockdata audit.blocks[domain] = blockdata
if len(save_block_audit_file) > 0: if save_block_audit_file:
log.info(f"Saving audit file to {save_block_audit_file}") log.info(f"Saving audit file to {save_block_audit_file}")
save_domain_block_audit_to_file(audit, save_block_audit_file) save_domain_block_audit_to_file(audit, save_block_audit_file)
@ -746,7 +746,7 @@ def augment_args(args, tomldata: str=None):
args.savedir = conf.get('savedir', '/tmp') args.savedir = conf.get('savedir', '/tmp')
if not args.blocklist_auditfile: if not args.blocklist_auditfile:
args.blocklist_auditfile = conf.get('blocklist_auditfile', '') args.blocklist_auditfile = conf.get('blocklist_auditfile', None)
if not args.export_fields: if not args.export_fields:
args.export_fields = conf.get('export_fields', []) args.export_fields = conf.get('export_fields', [])