From c01f1aaa442bc25cf571af6f6b0971d3a1765b78 Mon Sep 17 00:00:00 2001 From: orf Date: Sun, 27 Jul 2014 21:08:28 +0100 Subject: [PATCH] Fix small bug with request auto-detection --- example_application/src/example_site.py | 2 -- xcat/lib/requests/detector.py | 4 +++- xcat/xcat.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example_application/src/example_site.py b/example_application/src/example_site.py index 4edf3ce..9dddad0 100644 --- a/example_application/src/example_site.py +++ b/example_application/src/example_site.py @@ -107,7 +107,6 @@ def getChildren(node): def node_to_object(node): returner = {} - print node.getStringValue() for child in getChildren(node): if child is None: continue @@ -133,7 +132,6 @@ def execute(query): } returned_result.update(node_to_object(result)) returner.append(returned_result) - print "%s results" % len(returner) return returner diff --git a/xcat/lib/requests/detector.py b/xcat/lib/requests/detector.py index 4ac37d2..d21ee54 100644 --- a/xcat/lib/requests/detector.py +++ b/xcat/lib/requests/detector.py @@ -25,7 +25,9 @@ def change_parameter(self, target_parameter): :param target_parameter: A parameter name that the returned detector targets :return: A Detector that targets the given URI parameter """ - return Detector(self.checker, copy.deepcopy(self.requests)) + d = Detector(self.checker, copy.deepcopy(self.requests)) + d.requests.set_target_parameter(target_parameter) + return d def get_requester(self, injector, features=None): requester = self.requests.with_injector(injector) diff --git a/xcat/xcat.py b/xcat/xcat.py index 6e75ab6..5f28c38 100644 --- a/xcat/xcat.py +++ b/xcat/xcat.py @@ -70,7 +70,7 @@ def xcat(ctx, target, arguments, target_parameter, match_string, method, detecti OOBDocFeature.server = OOBHttpServer(host=public_ip, port=public_port) ctx.obj["target_param"] = target_parameter - request_maker = RequestMaker(target, method, arguments, target_parameter, checker=checker) + request_maker = RequestMaker(target, method, arguments, target_parameter if target_parameter != "*" else None, checker=checker) ctx.obj["detector"] = detector.Detector(checker, request_maker)