Add EXTRA_*_ARGS for wget, curl, and singlefile

This commit is contained in:
Ben Muthalaly 2024-02-21 15:13:06 -06:00
parent 31d05d8526
commit 4e69d2c9e1
8 changed files with 88 additions and 35 deletions

View file

@ -317,6 +317,23 @@ def ansi_to_html(text):
return COLOR_REGEX.sub(single_sub, text)
@enforce_types
def dedupe(*options: List[str]) -> List[str]:
"""
Deduplicates the given options. Options that come earlier in the list clobber
later conflicting options.
"""
seen_option_names = []
def test_seen(argument):
option_name = argument.split("=")[0]
if option_name in seen_option_names:
return False
else:
seen_option_names.append(option_name)
return True
return list(filter(test_seen, options))
class AttributeDict(dict):
"""Helper to allow accessing dict values via Example.key or Example['key']"""