def getChild(self, path, req): if path == "force": return self.force(req) if path == "ping": return self.ping(req) if path == "events": num = req.postpath.pop(0) req.prepath.append(num) num = int(num) # TODO: is this dead code? .statusbag doesn't exist,right? log.msg("getChild['path']: %s" % req.uri) return NoResource("events are unavailable until code gets fixed") filename = req.postpath.pop(0) req.prepath.append(filename) e = self.builder_status.getEventNumbered(num) if not e: return NoResource("No such event '%d'" % num) file = e.files.get(filename, None) if file == None: return NoResource("No such file '%s'" % filename) if type(file) == type(""): if file[:6] in ("<HTML>", "<html>"): return static.Data(file, "text/html") return static.Data(file, "text/plain") return file if path == "builds": return BuildsResource(self.builder_status, self.builder_control) return HtmlResource.getChild(self, path, req)
def getChild(self, path, req): if path == "force": return self.force(req) if path == "ping": return self.ping(req) if path == "cancelbuild": return self.cancelbuild(req) if path == "builds": return BuildsResource(self.builder_status) return HtmlResource.getChild(self, path, req)
def getChild(self, path, req): if path == "force": return ForceBuildActionResource(self.builder_status) if path == "ping": return self.ping(req) if path == "cancelbuild": return CancelChangeResource(self.builder_status) if path == "stopchange": return StopChangeResource(self.builder_status) if path == "builds": return BuildsResource(self.builder_status) return HtmlResource.getChild(self, path, req)