def workspace_find(ctx, file_grp, mimetype, page_id, file_id, output_field, download):
    """
    Find files.
    """
    workspace = Workspace(ctx.resolver, directory=ctx.directory, mets_basename=ctx.mets_basename)
    for f in workspace.mets.find_files(
            ID=file_id,
            fileGrp=file_grp,
            mimetype=mimetype,
            pageId=page_id,
        ):
        if download:
            workspace.download_file(f)
            workspace.save_mets()
        ret = '\t'.join([getattr(f, field) or '' for field in output_field])
        print(ret)
def workspace_find ( ctx , file_grp , mimetype , page_id , file_id , output_field , download ) : workspace = Workspace ( ctx . resolver , directory = ctx . directory , mets_basename = ctx . mets_basename ) for f in workspace . mets . find_files ( ID = file_id , fileGrp = file_grp , mimetype = mimetype , pageId = page_id , ) : if download : workspace . download_file ( f ) workspace . save_mets ( ) ret = '\t' . join ( [ getattr ( f , field ) or '' for field in output_field ] ) print ( ret )
Find files.