class RecentActivitySource:
    def __init__(self, lastDay):
        self.lastDay = lastDay
        self.recentActivity = RecentActivity(lastDay)
    
    def renderChart(self, width, height):
        chart = Chart()
        chart.chs = "%dx%d" % (width, height)

        configureChart(chart)
        earliestDay, maxValueCount = self.renderChartData(chart)
        renderMetadata(chart, earliestDay, maxValueCount)

        return chart

    def collectData(self):
        raise NotImplementedError()

    def interpretData(self):
        raise NotImplementedError()

    def renderChartData(self, chart):
        earliestDay = self.recentActivity.getEarliestDay()
        values = self.recentActivity.convertToValueArray()
        chart.addData(values)
        maxValueCount = len(values)
        return earliestDay, maxValueCount

    def printTestChartHtml(self):
        self.collectData()
        self.interpretData()
        chart = self.renderChart(450, 150)
        print(chart.asImgElement())
Exemplo n.º 2
0
class RecentActivitySource:
    def __init__(self, lastDay):
        self.lastDay = lastDay
        self.recentActivity = RecentActivity(lastDay)

    def renderChart(self, width, height):
        chart = Chart()
        chart.chs = "%dx%d" % (width, height)

        configureChart(chart)
        earliestDay, maxValueCount = self.renderChartData(chart)
        renderMetadata(chart, earliestDay, maxValueCount)

        return chart

    def collectData(self):
        raise NotImplementedError()

    def interpretData(self):
        raise NotImplementedError()

    def renderChartData(self, chart):
        earliestDay = self.recentActivity.getEarliestDay()
        values = self.recentActivity.convertToValueArray()
        chart.addData(values)
        maxValueCount = len(values)
        return earliestDay, maxValueCount

    def printTestChartHtml(self):
        self.collectData()
        self.interpretData()
        chart = self.renderChart(450, 150)
        print(chart.asImgElement())
 def __init__(self, lastDay, hudsonUrl, jobName):
     feedUrl = feedUrlTemplate % (hudsonUrl, jobName)
     AtomRecentActivity.__init__(self, lastDay, feedUrl)
     self.successes = RecentActivity(lastDay)
     self.failures = RecentActivity(lastDay)
 def __init__(self, lastDay):
     self.lastDay = lastDay
     self.recentActivity = RecentActivity(lastDay)
Exemplo n.º 5
0
 def __init__(self, lastDay):
     self.lastDay = lastDay
     self.recentActivity = RecentActivity(lastDay)