Пример #1
0
 def get_caliper_image(url):
     """returns a base64 string of the caliper image asked"""
     #url pattern: sftp://genologics.scilifelab.se/home/glsftp/clarity/year/month/processid/artifact-id-file-id.png
     artifact_attached_id= url.rsplit('.', 1)[0].rsplit('/', 1)[1].rsplit('-', 2)[0]
     #Couldn't use fileid in the url directly as it was sometimes wrong
     caliper_file_id = Artifact(lims=lims, id=artifact_attached_id).files[0].id
     try:
         my_file = lims.get_file_contents(id=caliper_file_id)
         encoded_string = base64.b64encode(my_file.read()).decode('utf-8')
         returnHTML=json.dumps(encoded_string)
         return returnHTML
     except Exception as message:
         print(message)
         raise tornado.web.HTTPError(404, reason='Error fetching caliper images')
Пример #2
0
 def get_frag_an_image(self,url):
     data = lims.get_file_contents(uri=url)
     encoded_string = base64.b64encode(data.read())
     returnHTML=json.dumps(encoded_string)
     return returnHTML
Пример #3
0
 def get_frag_an_image(self, url):
     data = lims.get_file_contents(uri=url)
     encoded_string = base64.b64encode(data.read())
     returnHTML = json.dumps(encoded_string)
     return returnHTML