Exemplo n.º 1
0
    def test_export_lig(self):

        ids = '19465464,18945920'.split(",")
        #ret = pubmed.exportReference(ids)
        sample_ris = fileutil.contentsOfFile("test/sample-medline.ris", False)
        #print "Sample %s" %sample_ris
        ret = pubmed.medline2ris(sample_ris)
        self.assertTrue(ret)
        fileutil.writeFile("tmp/output.ris", ret)
        print "##%s##" % ret
        self.assertIn('TY  - JOUR', ret)
Exemplo n.º 2
0
 def test_export_lig(self):
     
    
     ids='19465464,18945920'.split(",")
     #ret = pubmed.exportReference(ids)
     sample_ris = fileutil.contentsOfFile("test/sample-medline.ris", False)
     #print "Sample %s" %sample_ris
     ret = pubmed.medline2ris(sample_ris)
     self.assertTrue(ret)
     fileutil.writeFile("tmp/output.ris", ret)
     print "##%s##" %ret
     self.assertIn('TY  - JOUR', ret)
     
Exemplo n.º 3
0
def createFileDownloadResponse(filename=None, contents=None):
    from myutil import fileutil    
    raw = contents or  fileutil.contentsOfFile( filename )
    hr = HttpResponse(raw, content_type="application/raw")
    hr.set_cookie("fileDownload", "true", path="/")
    return hr
Exemplo n.º 4
0
def createFileDownloadResponse(filename=None, contents=None):
    from myutil import fileutil
    raw = contents or fileutil.contentsOfFile(filename)
    hr = HttpResponse(raw, content_type="application/raw")
    hr.set_cookie("fileDownload", "true", path="/")
    return hr