projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a9f1f2
)
Add a function to parse arguments for the replace parameter
author
kevan
<kevan@isnotajoke.com>
Mon, 20 Jul 2009 03:47:23 +0000
(20:47 -0700)
committer
kevan
<kevan@isnotajoke.com>
Mon, 20 Jul 2009 03:47:23 +0000
(20:47 -0700)
src/allmydata/web/common.py
patch
|
blob
|
history
diff --git
a/src/allmydata/web/common.py
b/src/allmydata/web/common.py
index 28aec62c50e879abaaa93da1d510e577f78cc7cd..0de47717675d8260a92b3cca1d29f141289b0989 100644
(file)
--- a/
src/allmydata/web/common.py
+++ b/
src/allmydata/web/common.py
@@
-21,6
+21,12
@@
def boolean_of_arg(arg):
assert arg.lower() in ("true", "t", "1", "false", "f", "0", "on", "off")
return arg.lower() in ("true", "t", "1", "on")
+def parse_replace_arg(replace):
+ if replace == "only-files":
+ return replace
+ else:
+ return boolean_of_arg(replace)
+
def get_root(ctx_or_req):
req = IRequest(ctx_or_req)
# the addSlash=True gives us one extra (empty) segment