Add a function to parse arguments for the replace parameter

This commit is contained in:
kevan 2009-07-19 20:47:23 -07:00
parent 3a9f1f2952
commit 7ab92c7511

View File

@ -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