Exemplo n.º 1
0
	def default(self, url1=None, url2=None, field=None):
		if not url1 or not url2 or not field:
			return dumps({'status':'error', 'message':'Need URIs and field'})
		extract1 = Extract(url1, datapath, cachepath, extractorpath) 
		extract2 = Extract(url2, datapath, cachepath, extractorpath)
		data1 = extract1.run()
		data2 = extract2.run()
		chart = ComparisonChart(url1, url2, data1, data2)
		url = chart.get_graph_url_for_field(field)
		return dumps({'status':'ok', 'url':url})		
Exemplo n.º 2
0
	def default(self, url=None, fields=None):
		if not url or not fields:
			return dumps({'status':'error', 'message':'Need URI and fields'})
		extract = Extract(url, datapath, cachepath, extractorpath)
		data = extract.run()
		chart = GoogleChart(data)
		field_arr = fields.split(",")
		nfield_arr = []
		for field in field_arr:
			field = field.strip()
			if field != '':
				nfield_arr.append(field)

		if len(nfield_arr) == 1:
			url = chart.get_graph_url_for_field(nfield_arr[0])
		else:
			url = chart.get_graph_url_for_fields(nfield_arr)
		return dumps({'status':'ok', 'url':url})		
Exemplo n.º 3
0
	def default(self, url=None):
		if not url:
		    return dumps({'status':'error', 'message':'Need URL'})
		extract = Extract(url, datapath, cachepath, extractorpath)
		data = extract.run()
		return dumps({'status':'ok', 'data':data})