debian/control: Add Build-Depends for `dh-python'.
[mLib-python] / url.pyx
diff --git a/url.pyx b/url.pyx
index 613630d..72467f1 100644 (file)
--- a/url.pyx
+++ b/url.pyx
@@ -1,31 +1,30 @@
-# -*-pyrex-*-
-#
-# $Id$
-#
-# Form-urlencoding functions
-#
-# (c) 2006 Straylight/Edgeware
-#
+### -*-pyrex-*-
+###
+### Form-urlencoding functions
+###
+### (c) 2006 Straylight/Edgeware
+###
 
-#----- Licensing notice -----------------------------------------------------
-#
-# This file is part of the Python interface to mLib.
-#
-# mLib/Python is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# mLib/Python is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with mLib/Python; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the Python interface to mLib.
+###
+### mLib/Python is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### mLib/Python is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with mLib/Python; if not, write to the Free Software Foundation,
+### 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
 
@@ -43,12 +42,15 @@ cdef class URLEncode:
       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:
+    """UE.result -> STR: the encoded string"""
     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):
@@ -57,6 +59,7 @@ cdef class URLEncode:
       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):
@@ -65,6 +68,7 @@ cdef class URLEncode:
       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):
@@ -76,6 +80,7 @@ cdef class URLEncode:
     dstr_destroy(&me.d)
 
 cdef class URLDecode:
+  """URLDecode(STR, [semip = False]): iterator over (KEY, VALUE) pairs"""
   cdef url_dctx ctx
   cdef char *p
 
@@ -111,6 +116,7 @@ cdef class URLDecode:
       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):
@@ -121,4 +127,4 @@ cdef class URLDecode:
   def __del__(me):
     xfree(me.p)
 
-#----- That's all, folks ----------------------------------------------------
+###----- That's all, folks --------------------------------------------------