@defer.inlineCallbacks
    def upload_async(self, docs, fname, progq, state):
        archive = docs['archive']
        auth = docs['auth']
        path = self.cache.data_file(docs['links'])
        op = yield self.session.upload(archive, state)
        status = yield op.status  # init uri and status
        if status['status'] == 'pending':
            if state.uri is None:
                state.save_op(op)
            uploader = Upload(self.session, self.nprocs, self.debug, state)
            if state.progress < state.size:
                yield uploader.upload(path, op, progq)
            status = yield op.finalize(auth, state.keys)
        if status['status'] != 'failed':
            account = yield self.session.async_account
            saved = yield self.cache.save_upload(
                fname, docs, op.uri, account, state.capsule['title'])
            defer.returnValue(saved)
dataset/ETHPy150Open longaccess/longaccess-client/lacli/command.py/LaArchiveCommand.upload_async/original