Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
eacc593
)
Added a simple function for producing an optionally parametrized URL.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 5 Aug 2012 16:08:15 +0000
(18:08 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 5 Aug 2012 16:08:15 +0000
(18:08 +0200)
wrw/proto.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/proto.py
b/wrw/proto.py
index
881f4e4
..
aed5c4e
100644
(file)
--- a/
wrw/proto.py
+++ b/
wrw/proto.py
@@
-156,3
+156,10
@@
def parstring(pars = {}, **augment):
if buf != "": buf += "&"
buf += urlq(key) + "=" + urlq(str(augment[key]))
return buf
+
+def parurl(url, pars = {}, **augment):
+ qs = parstring(pars, **augment)
+ if qs != "":
+ return url + "?" + qs
+ else:
+ return url