chiark
/
gitweb
/
~mdw
/
mLib-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 1.1.0.
[mLib-python]
/
url.pyx
diff --git
a/url.pyx
b/url.pyx
index ef7e36c997efd832b143d0bc6a560bc0f00ba5da..72467f16ddef8f4dfd30d440f9ae1a5b405d2d71 100644
(file)
--- a/
url.pyx
+++ b/
url.pyx
@@
-24,6
+24,7
@@
### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cdef class URLEncode:
### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cdef class URLEncode:
+ """URLEncode([strictp = False], [laxp = False], [semip = False])"""
cdef url_ectx ctx
cdef dstr d
cdef url_ectx ctx
cdef dstr d
@@
-41,12
+42,15
@@
cdef class URLEncode:
f = f | URLF_SEMI
me.ctx.f = f
def encode(me, char *name, char *value):
f = f | URLF_SEMI
me.ctx.f = f
def encode(me, char *name, char *value):
+ """UE.encode(NAME, VALUE): encode a key/value pair"""
url_enc(&me.ctx, &me.d, name, value)
return me
property result:
url_enc(&me.ctx, &me.d, name, value)
return me
property result:
+ """UE.result -> STR: the encoded string"""
def __get__(me):
return PyString_FromStringAndSize(me.d.buf, me.d.len)
property strictp:
def __get__(me):
return PyString_FromStringAndSize(me.d.buf, me.d.len)
property strictp:
+ """UE.strictp -> BOOL: strictly escape non-alphanumerics?"""
def __get__(me):
return _tobool(me.ctx.f & URLF_STRICT)
def __set__(me, val):
def __get__(me):
return _tobool(me.ctx.f & URLF_STRICT)
def __set__(me, val):
@@
-55,6
+59,7
@@
cdef class URLEncode:
else:
me.ctx.f = me.ctx.f & ~URLF_STRICT
property laxp:
else:
me.ctx.f = me.ctx.f & ~URLF_STRICT
property laxp:
+ """UE.laxp -> BOOL: only escape obviously unsafe characters?"""
def __get__(me):
return _tobool(me.ctx.f & URLF_LAX)
def __set__(me, val):
def __get__(me):
return _tobool(me.ctx.f & URLF_LAX)
def __set__(me, val):
@@
-63,6
+68,7
@@
cdef class URLEncode:
else:
me.ctx.f = me.ctx.f & ~URLF_LAX
property semip:
else:
me.ctx.f = me.ctx.f & ~URLF_LAX
property semip:
+ """UE.semip -> BOOL: separate key/value pairs with semicolons?"""
def __get__(me):
return _tobool(me.ctx.f & URLF_SEMI)
def __set__(me, val):
def __get__(me):
return _tobool(me.ctx.f & URLF_SEMI)
def __set__(me, val):
@@
-74,6
+80,7
@@
cdef class URLEncode:
dstr_destroy(&me.d)
cdef class URLDecode:
dstr_destroy(&me.d)
cdef class URLDecode:
+ """URLDecode(STR, [semip = False]): iterator over (KEY, VALUE) pairs"""
cdef url_dctx ctx
cdef char *p
cdef url_dctx ctx
cdef char *p
@@
-109,6
+116,7
@@
cdef class URLDecode:
raise StopIteration
return nn, vv
property semip:
raise StopIteration
return nn, vv
property semip:
+ """UD.semip -> BOOL: key/value pairs separated with semicolons?"""
def __get__(me):
return _tobool(me.ctx.f & URLF_SEMI)
def __set__(me, val):
def __get__(me):
return _tobool(me.ctx.f & URLF_SEMI)
def __set__(me, val):