def iiif_info_url(msid, filename): kwargs = { 'padded-msid': utils.pad_msid(msid), 'fname': filename } raw_link = (conf.IIIF % kwargs) return utils.pad_filename(msid, raw_link)
def pdf_uri(triple): """predict an article's pdf url. some article types don't have a PDF (like corrections) and some older articles that should have a pdf, don't. this function doesn't concern itself with those latter exceptions.""" content_type, msid, version = triple if content_type and any(lmap(lambda type: type in ['Correction', 'Retraction'], content_type)): return EXCLUDE_ME filename = "elife-%s-v%s.pdf" % (utils.pad_msid(msid), version) # ll: elife-09560-v1.pdf return cdnlink(msid, filename)
def figures_pdf_uri(triple): graphics, msid, version = triple filename_match = '-figsupp' if any(lmap(lambda graphic: graphic.get('xlink_href') and filename_match in graphic.get('xlink_href'), graphics)): filename = "elife-%s-figures-v%s.pdf" % (utils.pad_msid(msid), version) # ll: elife-09560-figures-v1.pdf figures_pdf_cdnlink = cdnlink(msid, filename) return cdn.url_exists(figures_pdf_cdnlink, msid) else: return None
def pdf_uri(triple): """predict an article's pdf url. some article types don't have a PDF (like corrections) and some older articles that should have a pdf, don't. this function doesn't concern itself with those latter exceptions.""" content_type, msid, version = triple if content_type and any( lmap(lambda type: type in ['Correction'], content_type)): return EXCLUDE_ME filename = "elife-%s-v%s.pdf" % (utils.pad_msid(msid), version ) # ll: elife-09560-v1.pdf return cdnlink(msid, filename)
def figures_pdf_uri(triple): graphics, msid, version = triple filename_match = '-figsupp' if (True in map( lambda graphic: graphic.get('xlink_href') and filename_match in graphic.get('xlink_href'), graphics)): filename = "elife-%s-figures-v%s.pdf" % ( utils.pad_msid(msid), version) # ll: elife-09560-figures-v1.pdf figures_pdf_cdnlink = cdnlink(msid, filename) return cdn.url_exists(figures_pdf_cdnlink, msid) else: return None
def iiiflink(msid, filename): kwargs = {'padded-msid': utils.pad_msid(msid), 'fname': filename} raw_link = (conf.CDN_IIIF % kwargs) return utils.pad_filename(msid, raw_link)
def cdnlink(msid, filename): kwargs = {'padded-msid': utils.pad_msid(msid), 'fname': filename} return conf.CDN % kwargs
def glencoe_url(msid): doi = "10.7554/eLife." + utils.pad_msid(msid) url = "https://movie-usa.glencoesoftware.com/metadata/" + doi return url
def xml_uri(params): """predict an article's xml url.""" msid, version = params filename = "elife-%s-v%s.xml" % (utils.pad_msid(msid), version ) # ll: elife-09560-v1.xml return cdnlink(msid, filename)
def xml_uri(params): """predict an article's xml url.""" msid, version = params filename = "elife-%s-v%s.xml" % (utils.pad_msid(msid), version) # ll: elife-09560-v1.xml return cdnlink(msid, filename)
def cdnlink(msid, filename): kwargs = { 'padded-msid': utils.pad_msid(msid), 'fname': filename } return conf.CDN % kwargs