Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def size(self, req):
_path = self.abspath(req)
if _path.exists():
return format_size(_path.stat().st_size)
def bitstream_link(oid, spec):
url = cdstar.SERVICE_URL.path(
'/bitstreams/{0}/{1}'.format(oid, spec['bitstreamid'])).as_string()
return HTML.a(
'{0} [{1}]'.format(spec['bitstreamid'], format_size(spec['filesize'])),
href=url)