From 74207d8334dc0340a9dfb21c24766080fe418cab Mon Sep 17 00:00:00 2001 From: kevan Date: Sun, 19 Jul 2009 20:48:31 -0700 Subject: [PATCH] Alter filenode.py to use parse_replace_arg --- src/allmydata/web/filenode.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/allmydata/web/filenode.py b/src/allmydata/web/filenode.py index 05c12279..9b2c4535 100644 --- a/src/allmydata/web/filenode.py +++ b/src/allmydata/web/filenode.py @@ -15,7 +15,7 @@ from allmydata.util import log, base32 from allmydata.web.common import text_plain, WebError, RenderMixin, \ boolean_of_arg, get_arg, should_create_intermediate_directories, \ - MyExceptionHandler + MyExceptionHandler, parse_replace_arg from allmydata.web.check_results import CheckResults, \ CheckAndRepairResults, LiteralCheckResults from allmydata.web.info import MoreInfo @@ -109,7 +109,8 @@ class PlaceHolderNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin): def render_PUT(self, ctx): req = IRequest(ctx) t = get_arg(req, "t", "").strip() - replace = boolean_of_arg(get_arg(req, "replace", "true")) + replace = parse_replace_arg(get_arg(req, "replace", "true")) + assert self.parentnode and self.name if req.getHeader("content-range"): raise WebError("Content-Range in PUT not yet supported", @@ -212,7 +213,8 @@ class FileNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin): def render_PUT(self, ctx): req = IRequest(ctx) t = get_arg(req, "t", "").strip() - replace = boolean_of_arg(get_arg(req, "replace", "true")) + replace = parse_replace_arg(get_arg(req, "replace", "true")) + if not t: if self.node.is_mutable(): return self.replace_my_contents(req) -- 2.45.2