mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
Add a function to parse arguments for the replace parameter
This commit is contained in:
parent
3a9f1f2952
commit
7ab92c7511
@ -21,6 +21,12 @@ def boolean_of_arg(arg):
|
|||||||
assert arg.lower() in ("true", "t", "1", "false", "f", "0", "on", "off")
|
assert arg.lower() in ("true", "t", "1", "false", "f", "0", "on", "off")
|
||||||
return arg.lower() in ("true", "t", "1", "on")
|
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):
|
def get_root(ctx_or_req):
|
||||||
req = IRequest(ctx_or_req)
|
req = IRequest(ctx_or_req)
|
||||||
# the addSlash=True gives us one extra (empty) segment
|
# the addSlash=True gives us one extra (empty) segment
|
||||||
|
Loading…
Reference in New Issue
Block a user