urlreducer: define DEFAULT_PROVIDER later
This commit is contained in:
parent
517bf21d25
commit
9417e2ba93
@ -60,12 +60,14 @@ def load(context):
|
|||||||
|
|
||||||
# MODULE CORE #########################################################
|
# MODULE CORE #########################################################
|
||||||
|
|
||||||
def reduce(url, provider=DEFAULT_PROVIDER):
|
def reduce(url, provider=None):
|
||||||
"""Ask the url shortner website to reduce given URL
|
"""Ask the url shortner website to reduce given URL
|
||||||
|
|
||||||
Argument:
|
Argument:
|
||||||
url -- the URL to reduce
|
url -- the URL to reduce
|
||||||
"""
|
"""
|
||||||
|
if provider is None:
|
||||||
|
provider = DEFAULT_PROVIDER
|
||||||
return PROVIDERS[provider][0](PROVIDERS[provider][1], url)
|
return PROVIDERS[provider][0](PROVIDERS[provider][1], url)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user