Ejemplo n.º 1
0
 def getChild(self, path, req):
   if path == "build":
     if not self.getAuthz(req).actionAllowed('forceBuild',
                                             req):
       return Redirect(path_to_authfail(req))
     return self.build(req)
   return HtmlResource.getChild(self, path, req)
Ejemplo n.º 2
0
 def getChild(self, path, req):
     if path == '':
         return Redirect('..')
     for s in self.build_status.getSteps():
         if s.getName() == path:
             return JhStatusResourceBuildStep(self.build_status, s)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 3
0
 def getChild(self, path, req):
   if path == "build":
     if not self.getAuthz(req).actionAllowed('forceBuild',
                                             req):
       return Redirect(path_to_authfail(req))
     return self.build(req)
   return HtmlResource.getChild(self, path, req)
Ejemplo n.º 4
0
    def getChild(self, path, req):
        status = self.getStatus(req)
        projects = status.getProjects()

        if path in projects:
            return CodeBasesResource(projects[path], self.numbuilds)
        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 5
0
    def getChild(self, path, req):
        if path == "force":
            return self.force(req)
        if path == "stop":
            return self.stop(req)

        return HtmlResource.getChild(self, path, req)
    def getChild(self, path, req):
        if path == "forceselected":
            return self.forceselected(req)
        if path == "stopselected":
            return self.stopselected(req)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 7
0
    def getChild(self, path, req):
        if path == "forceselected":
            return self.forceselected(req)
        if path == "stopselected":
            return self.stopselected(req)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
 def getChild(self, path, req):
     if path == '':
         return Redirect('..')
     parent = req.site.buildbot_service
     if path in parent.slaves:
         return JhBuildbotResource(path, req)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 10
0
    def getChild(self, path, req):
        if path == "forceall":
            return self.forceall(req)
        if path == "stopall":
            return self.stopall(req)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 11
0
 def getChild(self, path, req):
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 12
0
    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)
Ejemplo n.º 13
0
    def getChild(self, path, req):
        if path == "builders":
            return BuildersResource(self.project, self.numbuilds)
        elif path == "comparison":
            return BranchComparisonResource(self.project, self.numbuilds)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 14
0
 def getChild(self, path, req):
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 15
0
 def getChild(self, path, request):
     if path == "delete":
         return DeleteProject(self.project)
     builder = self.getStatus(request).getBuilder(self.project)
     build = builder.getBuild(int(path))
     if build:
         return Build(build)
     return HtmlResource.getChild(self, path, request)
Ejemplo n.º 16
0
 def getChild(self, path, request):
     if path == "delete":
         return DeleteProject(self.project)
     builder = self.getStatus(request).getBuilder(self.project)
     build = builder.getBuild(int(path))
     if build:
         return Build(build)
     return HtmlResource.getChild(self, path, request)
Ejemplo n.º 17
0
 def getChild(self, path, req):
     tpath = None
     if path:
         tpath = tuple(path.split(self.nameDelim))
     if tpath:
         tr = self.build_status.getTestResults().get(tpath)
     if tr:
         return StatusResourceBuildTest(self.build_status, tr)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 18
0
    def getChild(self, path, req):
        if path == "forceselected":
            return self.forceselected(req)
        if path == "stopselected":
            return self.stopselected(req)
        if path == "cancelpendingselected":
            return CancelAllPendingBuildsActionResource(self.status, 'selected')

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 19
0
    def getChild(self, path, req):
        if path == "ansi":
            self.ansiParser = Ansi2HTML()

        if path == "text" or path == "ansi":
            self.printAs = path
            return self

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 20
0
    def getChild(self, path, req):
        s = self.getStatus(req)
        if path in s.getBuilderNames():
            builder_status = s.getBuilder(path)
            return StatusResourceBuilder(builder_status)
        if path == "_all":
            return StatusResourceAllBuilders(self.getStatus(req))

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 21
0
    def getChild(self, path, req):
        if path == "stop":
            return self.stop(req)
        if path == "rebuild":
            return self.rebuild(req)
        if path == "steps":
            return StepsResource(self.build_status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 22
0
    def getChild(self, path, req):
        if path == "stop":
            return self.stop(req)
        if path == "rebuild":
            return self.rebuild(req)
        if path == "steps":
            return StepsResource(self.build_status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 23
0
    def getChild(self, path, req):
        s = self.getStatus(req)
        if path in s.getBuilderNames():
            builder_status = s.getBuilder(path)
            return StatusResourceBuilder(builder_status)
        if path == "_all":
            return StatusResourceAllBuilders(self.getStatus(req))

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 24
0
    def getChild(self, path, req):
        if path == "forceselected":
            return self.forceselected(req)
        if path == "stopselected":
            return self.stopselected(req)
        if path == "cancelpendingselected":
            return CancelAllPendingBuildsActionResource(self.status, 'selected')

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 25
0
    def getChild(self, path, req):
        if path == "forceall":
            return self.forceall(req)
        if path == "stopall":
            return self.stopall(req)
        if path == "stopchangeall":
            return StopChangeAllResource(self.status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 26
0
    def getChild(self, path, req):
        if path == "forceall":
            return self.forceall(req)
        if path == "stopall":
            return self.stopall(req)
        if path == "stopchangeall":
            return self.stopchangeall(req)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 27
0
 def getChild(self, path, req):
     tpath = None
     if path:
         tpath = tuple(path.split(self.nameDelim))
     if tpath:
         tr = self.build_status.getTestResults().get(tpath)
     if tr:
         return StatusResourceBuildTest(self.build_status, tr)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 28
0
    def getChild(self, path, req):
        s = self.getStatus(req)
        if path in s.getBuilderNames():
            builder_status = s.getBuilder(path)
            return StatusResourceBuilder(s, builder_status, self.numbuilds)
        if path == "_all":
            return StatusResourceAllBuilders(self.getStatus(req))
        if path == "_selected":
            return StatusResourceSelectedBuilders(self.getStatus(req))

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 29
0
    def getChild(self, path, req):
        if path == "forceall":
            return self.forceall(req)
        if path == "stopall":
            return self.stopall(req)
        if path == "stopchangeall":
            return StopChangeAllResource(self.status)
        if path == "cancelpendingall":
            return CancelAllPendingBuildsActionResource(self.status, 'all')

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 30
0
    def getChild(self, path, req):
        if path == "forceall":
            return self.forceall(req)
        if path == "stopall":
            return self.stopall(req)
        if path == "stopchangeall":
            return StopChangeAllResource(self.status)
        if path == "cancelpendingall":
            return CancelAllPendingBuildsActionResource(self.status, 'all')

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 31
0
    def getChild(self, path, req):
        try:
            num = int(path)
        except ValueError:
            num = None
        if num is not None:
            build_status = self.builder_status.getBuild(num)
            if build_status:
                return StatusResourceBuild(build_status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 32
0
    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)
Ejemplo n.º 33
0
    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)
Ejemplo n.º 34
0
    def getChild(self, path, req):
        try:
            num = int(path)
        except ValueError:
            num = None
        if num is not None:
            build_status = self.builder_status.getBuild(num)
            if build_status:
                return StatusResourceBuild(build_status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 35
0
    def getChild(self, path, req):
        s = self.getStatus(req)
        if path in s.getBuilderNames():
            builder_status = s.getBuilder(path)
            builder_control = None
            c = self.getControl(req)
            if c:
                builder_control = c.getBuilder(path)
            return StatusResourceBuilder(builder_status, builder_control)
        if path == "_all":
            return StatusResourceAllBuilders(self.getStatus(req), self.getControl(req))

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 36
0
    def getChild(self, path, req):
        if path == "stop":
            return self.stop(req)
        if path == "cancel":
            return self.cancelBuild(req)
        if path == "stopchain":
            return self.stopchain(req)
        if path == "steps":
            return StepsResource(self.build_status)
        if path == "tests":
            return TestsResource(self.build_status)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 37
0
    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)
Ejemplo n.º 38
0
    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)
Ejemplo n.º 39
0
    def getChild(self, path, req):
        s = self.getStatus(req)
        if path in s.getBuilderNames():
            builder_status = s.getBuilder(path)
            builder_control = None
            c = self.getControl(req)
            if c:
                builder_control = c.getBuilder(path)
            return StatusResourceBuilder(builder_status, builder_control)
        if path == "_all":
            return StatusResourceAllBuilders(self.getStatus(req),
                                             self.getControl(req))

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 40
0
    def getChild(self, path, req):
        try:
            num = int(path)
        except ValueError:
            num = None
        if num is not None:
            build_status = self.builder_status.getBuild(num)
            if build_status:
                if self.builder_control:
                    build_control = self.builder_control.getBuild(num)
                else:
                    build_control = None
                return StatusResourceBuild(build_status, build_control, self.builder_control)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 41
0
    def getChild(self, path, req):
        try:
            num = int(path)
        except ValueError:
            num = None
        if num is not None:
            build_status = self.builder_status.getBuild(num)
            if build_status:
                if self.builder_control:
                    build_control = self.builder_control.getBuild(num)
                else:
                    build_control = None
                return StatusResourceBuild(build_status, build_control,
                                           self.builder_control)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 42
0
 def getChild(self, path, req):
     for log in self.step_status.getLogs():
         if path == log.getName():
             if log.hasContents():
                 content = log.getText()
                 is_html_log = isinstance(log, HTMLLogFile)
                 if is_html_log and log.content_type == 'json':
                     return JSONTestResource(log, self.step_status)
                 elif is_html_log and (log.content_type == 'xml' or
                                       ('xml-stylesheet' in content
                                        or 'nosetests' in content)):
                     return XMLTestResource(log, self.step_status)
                 else:
                     return IHTMLLog(interfaces.IStatusLog(log))
             return NoResource("Empty Log '%s'" % path)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 43
0
 def getChild(self, path, req):
     if path in self.getBuilderNames(req):
         return ProjectStatus(path)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 44
0
 def getChild(self, path, req):
     if path == "logs":
         return LogsResource(self.step_status)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 45
0
    def getChild(self, path, req):
        if path is "logs":
            return BuildtrackerLogsResource(self.buildtrackerDbCon)

        return HtmlResource.getChild(self, path, req)
Ejemplo n.º 46
0
 def getChild(self, path, req):
     if path in self.getBuilderNames(req):
         return ProjectStatus(path)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 47
0
 def getChild(self, path, req):
     if path == "logs":
         return LogsResource(self.step_status)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 48
0
 def getChild(self, path, req):
     for s in self.build_status.getSteps():
         if s.getName() == path:
             return StatusResourceBuildStep(self.build_status, s)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 49
0
 def getChild(self, path, req):
     if path == "text":
         self.asText = True
         return self
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 50
0
 def getChild(self, path, req):
     for s in self.build_status.getSteps():
         if s.getName() == path:
             return StatusResourceBuildStep(self.build_status, s)
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 51
0
 def getChild(self, path, req):
     # if path == "logs":
     #    return LogsResource(self.step_status) #TODO we need another class
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 52
0
 def getChild(self, path, req):
     # if path == "logs":
     # return LogsResource(self.step_status) #TODO we need another class
     return HtmlResource.getChild(self, path, req)
Ejemplo n.º 53
0
 def getChild(self, path, req):
     if path == "text":
         self.asText = True
         return self
     return HtmlResource.getChild(self, path, req)