Changeset 1054d21 in osmose-frontend for errors.py


Ignore:
Timestamp:
Oct 29, 2012 8:49:12 PM (7 years ago)
Author:
Frédéric Rodrigo <frodrigo@…>
Branches:
master
Children:
c537e71
Parents:
a471d0e
Message:

Switch to graph to matplotlib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • errors.py

    r184d4e1 r1054d21  
    3131    return map(lambda x: int(x), filter(lambda x: x and x!='',s).split(',')) 
    3232 
    33 @route('/errors/graph.png') 
    34 def graph(db): 
     33@route('/errors/graph.<format:ext>') 
     34def graph(db, format='png'): 
    3535    class options: 
    3636        sources = request.params.get('sources', type=int_list, default=[]) 
     
    4242 
    4343    try: 
    44         data = errors_graph.make_plt(db, options) 
    45         response.content_type = "image/png" 
     44        data = errors_graph.make_plt(db, options, format) 
     45        response.content_type = {'png':'image/png', 'svg':'image/svg+xml', 'pdf':'application/pdf'}[format] 
    4646        return data 
    4747    except Exception, e: 
Note: See TracChangeset for help on using the changeset viewer.