Using the basis architecture from the python-marconiclient package. This code doesn't really work yet, but I wanted to get an initial version up as there was some interest.
10 lines
280 B
Python
10 lines
280 B
Python
import urllib
|
|
|
|
|
|
def proc_template(template, **kwargs):
|
|
"""
|
|
Processes a templated URL by substituting the
|
|
dictionary args and returning the strings.
|
|
"""
|
|
return template.format(**dict([(k, urllib.quote(v))
|
|
for k, v in kwargs.items()])) |