コード例 #1
0
def playrate(request, param):
    import views, library, generate, imggen
    try:
        if "/" in param:
            fields = param.split("/")
            selector = "/".join(fields[1:])
            context = views.interpretRequest(request, fields[0])
        else:
            selector = "all"
            context = views.interpretRequest(request, param)
        import selectors
        data = generate.getPlayRateData(context, selector)
        (img, imap) = imggen.createPlayRateGraph(context, data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #2
0
def mostPlayedCumulativeTimeline(request, param):
    import library, views, imggen, generate
    try:
        context = views.interpretRequest(request, param)
        data = generate.getMostPlayedTimelineData(context)
        img = imggen.createMostPlayedTimelineGraph(context, data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #3
0
def lagHistogram(request, param):
    import views, library, generate, imggen
    try:
        context = views.interpretRequest(request, param)
        data = generate.getLagData(context)
        img = imggen.createLagHistogram(context, data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #4
0
def pbmGraph(request, param):
    import library, views, imggen, generate
    try:
        context = views.interpretRequest(request, param)
        data = generate.getPBMData(context)
        img = imggen.createPBMGraph(context, data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #5
0
def morgansPieCharts(request, param):
    import views, library, generate, imggen
    try:
        context = views.interpretRequest(request, param)
        data = generate.getMorgansPieChartsData(context.geek)
        img = imggen.createMorgansPieCharts(data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #6
0
def playsByQuarter(request, param):
    import views, library, generate, imggen
    try:
        context = views.interpretRequest(request, param)
        data = generate.getPlaysByQuarterData(context, 1990)
        img = imggen.createPlaysForYearByQuarterPlot(data, context.imageSpec, 1990)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #7
0
def playrateprevown(request, param):
    import views, library, generate, imggen
    try:
        context = views.interpretRequest(request, param)
        import selectors
        data = generate.getPlayRateData(context, "prevowned")
        (img, imap) = imggen.createPlayRateGraph(context, data)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #8
0
def firstPlayVsRating(request, param):
    import views, library, generate, imggen
    try:
        context = views.interpretRequest(request, param)
        data = generate.getFirstPlayVsRatingData(context.geek)
        years = generate.getGeekYears(context.geek)
        img = imggen.createFirstPlayVsRatingGraph(context, data, years)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #9
0
def category(request, param):
    import library, views, imggen
    try:
        fields = param.split("/")
        context = views.interpretRequest(request, fields[0])
        cattype = fields[1]
        cat = "/".join(fields[2:])
        img = imggen.plotCategoryRatings(context, cattype, cat)
        return library.imageResponse(img)
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")
コード例 #10
0
def morePieCharts(request, param):
    import library, imggen, generate, views
    try:
        fields = param.split("/")
        if len(fields) > 0:
            context = views.interpretRequest(request, fields[0])
            (plays, messages, year, month, day, args) = context.substrate.getPlaysForDescribedRange(fields[1:])
            data = generate.morePieChartData(plays)
            img = imggen.createMorePieCharts(data)
            return library.imageResponse(img)
        else:
            img = open("error.png")
            return webserver.response(img, content_type="image/png")
    except library.NoSuchGeekException:
        img = open("error.png")
        return webserver.response(img, content_type="image/png")