Esempio n. 1
0
 def get(self):
     url=self.request.get('ref')
     try:
         refs = getentities.get_entity_references(url)
     except getentities.DownloadError, e:
         refs = {'error': 'Download Error: %s.  Try reloading' % str(e)}
         self.response.set_status(400)
Esempio n. 2
0
 def get(self):
     ref = self.request.get('ref', '')
     context = dict(ref=ref,
                    name=self.request.get('name', None))
     try:
         refs = getentities.get_entity_references(ref)
     except getentities.DownloadError, e:
         context['error'] = "Couldn't download external resource: %s" % str(e)
         refs = []
Esempio n. 3
0
 def get(self):
     url=self.request.get('ref')
     refs = getentities.get_entity_references(url)
     self.response.headers['Content-Type'] = 'application/json'
     self.response.out.write(json.dumps(refs))
Esempio n. 4
0
 def get(self):
     ref = self.request.get('ref', '')
     context = dict(ref=ref,
                    name=self.request.get('name', None),
                    refs=getentities.get_entity_references(ref))
     self.render("ref.html", context)