forked from flt/tools
First commit
Former-commit-id: 424079609133edcc501ae185509836ee1181a02c
This commit is contained in:
24
change_font/util/url.py
Normal file
24
change_font/util/url.py
Normal file
@ -0,0 +1,24 @@
|
||||
from urllib.parse import quote
|
||||
|
||||
|
||||
def encode(val):
|
||||
val = quote(val, 'utf-8')
|
||||
return val
|
||||
|
||||
|
||||
def url_format_list(parameters):
|
||||
param_list = []
|
||||
for (k, v) in parameters:
|
||||
param_str = '{}={}'.format(k, v)
|
||||
param_list.append(param_str)
|
||||
string_to_sign = '&'.join(param_list)
|
||||
return string_to_sign
|
||||
|
||||
|
||||
def url_format(parameters):
|
||||
param_list = []
|
||||
for key, value in parameters.items():
|
||||
param_str = '{}={}'.format(key, value)
|
||||
param_list.append(param_str)
|
||||
string_to_sign = '&'.join(param_list)
|
||||
return string_to_sign
|
Reference in New Issue
Block a user