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:
51a1371
)
Allow None in parurl values to omit keys.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 21 Mar 2018 16:15:16 +0000
(17:15 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 21 Mar 2018 16:15:16 +0000
(17:15 +0100)
wrw/proto.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/proto.py
b/wrw/proto.py
index
80e2419
..
70f8f77
100644
(file)
--- a/
wrw/proto.py
+++ b/
wrw/proto.py
@@
-187,11
+187,15
@@
def parstring(pars={}, **augment):
del augment[key]
else:
val = pars[key]
+ if val is None:
+ continue
if buf != "": buf += "&"
buf += urlq(key) + "=" + urlq(str(val))
- for key in augment:
+ for key, val in augment.items():
+ if val is None:
+ continue
if buf != "": buf += "&"
- buf += urlq(key) + "=" + urlq(str(
augment[key]
))
+ buf += urlq(key) + "=" + urlq(str(
val
))
return buf
def parurl(url, pars={}, **augment):