def copy_finfo(finfo, storage_dir): out_file = os.path.join(storage_dir, "%s-%s.%s" % (finfo["sample"], finfo["ext"], finfo["type"])) out_file = os.path.abspath(out_file) if not shared.up_to_date(out_file, finfo): logger.info("Storing in local filesystem: %s" % out_file) shutil.copy(finfo["path"], out_file) return out_file
def _copy_finfo(finfo, storage_dir, pass_uptodate=False): """Copy a file into the output storage directory. """ out_file = _get_file_upload_path(finfo, storage_dir) if not shared.up_to_date(out_file, finfo): logger.info("Storing in local filesystem: %s" % out_file) shutil.copy(finfo["path"], out_file) return out_file if pass_uptodate: return out_file
def copy_finfo_directory(finfo, storage_dir): """Copy a directory into the final output directory. """ out_dir = os.path.abspath(os.path.join(storage_dir, finfo["ext"])) if not shared.up_to_date(out_dir, finfo): logger.info("Storing directory in local filesystem: %s" % out_dir) if utils.file_exists(out_dir): shutil.rmtree(out_dir) shutil.copytree(finfo["path"], out_dir) return out_dir
def copy_finfo(finfo, storage_dir): if finfo.has_key("sample"): out_file = os.path.join( storage_dir, "%s-%s.%s" % (finfo["sample"], finfo["ext"], finfo["type"])) else: out_file = os.path.join(storage_dir, os.path.basename(finfo["path"])) out_file = os.path.abspath(out_file) if not shared.up_to_date(out_file, finfo): logger.info("Storing in local filesystem: %s" % out_file) shutil.copy(finfo["path"], out_file) return out_file
def copy_finfo(finfo, storage_dir): """Copy a file into the output storage directory. """ if "sample" in finfo: out_file = os.path.join(storage_dir, "%s-%s.%s" % (finfo["sample"], finfo["ext"], finfo["type"])) else: out_file = os.path.join(storage_dir, os.path.basename(finfo["path"])) out_file = os.path.abspath(out_file) if not shared.up_to_date(out_file, finfo): logger.info("Storing in local filesystem: %s" % out_file) shutil.copy(finfo["path"], out_file) return out_file
def copy_finfo_directory(finfo, storage_dir): """Copy a directory into the final output directory. """ out_dir = os.path.abspath(os.path.join(storage_dir, finfo["ext"])) if not shared.up_to_date(out_dir, finfo): logger.info("Storing directory in local filesystem: %s" % out_dir) if os.path.exists(out_dir): shutil.rmtree(out_dir) shutil.copytree(finfo["path"], out_dir) for tmpdir in ["tx", "tmp"]: if os.path.exists(os.path.join(out_dir, tmpdir)): shutil.rmtree(os.path.join(out_dir, tmpdir)) os.utime(out_dir, None) return out_dir