def download_and_print(self, remote_path): # Download to temporary file fd, temp = Path.tempfile(prefix='reprozip_output_') os.close(fd) self.download(remote_path, temp) # Output to stdout with temp.open('rb') as fp: copyfile(fp, stdout_bytes) temp.remove()
def download_and_print(self, remote_path): remote_path = join_root(self.root, remote_path) # Output to stdout if not remote_path.exists(): logging.critical("Can't get output file (doesn't exist): %s", remote_path) sys.exit(1) with remote_path.open('rb') as fp: copyfile(fp, stdout_bytes)
def download_and_print(self, remote_path): remote_path = join_root(self.root, remote_path) # Output to stdout if not remote_path.exists(): logger.critical("Can't get output file (doesn't exist): %s", remote_path) return False with remote_path.open('rb') as fp: copyfile(fp, sys.stdout.buffer) return True
def download_and_print(self, remote_path): # Download to temporary file fd, temp = Path.tempfile(prefix='reprozip_output_') os.close(fd) download_status = self.download(remote_path, temp) if download_status is not None and not download_status: return False # Output to stdout with temp.open('rb') as fp: copyfile(fp, stdout_bytes) temp.remove() return True