Mercurial > libervia-web
comparison src/server/utils.py @ 1027:46ce20494a1b
server (utils): added "safe" attribute to quote
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 22 Jan 2018 08:53:03 +0100 |
parents | 2cb60ef2a76f |
children | f2170536ba23 |
comparison
equal
deleted
inserted
replaced
1026:38cfee0eed48 | 1027:46ce20494a1b |
---|---|
17 # You should have received a copy of the GNU Affero General Public License | 17 # You should have received a copy of the GNU Affero General Public License |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 import urllib | 19 import urllib |
20 | 20 |
21 | 21 |
22 def quote(value): | 22 def quote(value, safe='@'): |
23 """shortcut to quote an unicode value for URL""" | 23 """shortcut to quote an unicode value for URL""" |
24 return urllib.quote(value.encode('utf-8'), safe='@') | 24 return urllib.quote(value.encode('utf-8'), safe=safe) |