Ejemplo n.º 1
0
def traffic(name=None):
    title="All traffic"
    dummy = str(random.randint(0, 999999)) # dummy variable so thatbrowser gets new updated picture
    imagemonth=graphing.generate_monthly('/tmp/rrd_run/total.rrd')
    imageweek=graphing.generate_weekly('/tmp/rrd_run/total.rrd')
    imageday=graphing.generate_daily('/tmp/rrd_run/total.rrd')
    return render_template('traffic.html', name=name, title=title,\
navlinks=navlinks, imagemonth=imagemonth, imageweek=imageweek, imageday=imageday, cityid=-1, dummy=dummy)
Ejemplo n.º 2
0
def citytraffic(cityid):
    dummy = str(random.randint(0, 999999)) # dummy variable so thatbrowser gets new updated picture
    c = queries.get_city(cityid)
    title="City of " + c.name + ": Recent traaffic"
    imagemonth = graphing.generate_monthly(c.rrdtool_loc)
    imageweek = graphing.generate_weekly(c.rrdtool_loc)
    imageday = graphing.generate_daily(c.rrdtool_loc)
    return render_template('traffic.html', title=title,\
navlinks=navlinks, imagemonth=imagemonth, imageweek=imageweek, imageday=imageday, cityid=cityid, dummy=dummy)