def __call__(self, tpart):
logger.info(msg='<STR_LIT>',<EOL>detail='<STR_LIT>'.format(name=tpart.name))<EOL>with tempfile.NamedTemporaryFile(<EOL>mode='<STR_LIT>', buffering=pipebuf.PIPE_BUF_BYTES) as tf:<EOL><INDENT>with pipeline.get_upload_pipeline(PIPE, tf,<EOL>rate_limit=self.rate_limit,<EOL>gpg_key=self.gpg_key) as pl:<EOL><INDENT>tpart.tarfile_write(pl.stdin)<EOL><DEDENT>tf.flush()<EOL>url = '<STR_LIT>'.format(<EOL>self.backup_prefix.rstrip('<STR_LIT:/>'), number=tpart.name)<EOL>logger.info(msg='<STR_LIT>',<EOL>detail='<STR_LIT>'.format(url=url))<EOL>def log_volume_failures_on_error(exc_tup, exc_processor_cxt):<EOL><INDENT>def standard_detail_message(prefix='<STR_LIT>'):<EOL><INDENT>return (prefix +<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(n=exc_processor_cxt,<EOL>name=tpart.name))<EOL><DEDENT>typ, value, tb = exc_tup<EOL>del exc_tup<EOL>if issubclass(typ, socket.error):<EOL><INDENT>socketmsg = value[<NUM_LIT:1>] if isinstance(value, tuple) else value<EOL>logger.info(<EOL>msg='<STR_LIT>',<EOL>detail=standard_detail_message(<EOL>"<STR_LIT>"<EOL>.format(socketmsg)))<EOL><DEDENT>elif is_s3_response_error(typ, value):<EOL><INDENT>logger.info(<EOL>msg='<STR_LIT>',<EOL>detail=standard_detail_message())<EOL><DEDENT>else:<EOL><INDENT>raise typ(value).with_traceback(tb)<EOL><DEDENT><DEDENT>@retry(retry_with_count(log_volume_failures_on_error))<EOL>def put_file_helper():<EOL><INDENT>tf.seek(<NUM_LIT:0>)<EOL>return self.blobstore.uri_put_file(self.creds, url, tf)<EOL><DEDENT>clock_start = time.time()<EOL>k = put_file_helper()<EOL>clock_finish = time.time()<EOL>kib_per_second = format_kib_per_second(clock_start, clock_finish,<EOL>k.size)<EOL>logger.info(<EOL>msg='<STR_LIT>',<EOL>detail=('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(url=url, kib_per_second=kib_per_second)))<EOL><DEDENT>return tpart<EOL>
Synchronous version of the upload wrapper