py.lib

Yohn Y. 2022-08-25 Parent:84b54a8a6d4c

39:b8d559c989d6 Go to Latest

py.lib/webapp/url.py

+ Возможность воссоздавать объекты классов из кортежей и словарей

History
1 # -*- coding: utf-8 -*-
2 # ---
3 # Инструменты для работы с URL
4 # ---
5 from base64 import urlsafe_b64encode as _b64e, urlsafe_b64decode as _b64d
6 from urllib.parse import quote as urlquote
9 def encode(buf):
10 return _b64e(buf.encode('UTF-8')).decode('UTF-8')
13 def decode(buf):
14 return _b64d(buf.encode('UTF-8')).decode('UTF-8')