def cbCreateOpen(rsp): value = { 'username': self.username, 'filename': self.filename } value.update(rsp.headers) return url.encode_url_string(value)
def succeed(self, result): if result is None: rsp = 'OK\r\n' else: if isinstance(result, dict): result = url.encode_url_string(result) rsp = 'OK %s\r\n' % result self.transport.write(rsp)
def cbCreateOpen(rsp): """ return the generated filename and secret, and the response received from mogilefs: fid, dev_count, devids, paths """ value = { 'username': self.username, 'filename': self.filename, 'secret' : self.secret } value.update(rsp.headers) return url.encode_url_string(value)
def submitHeaders(self): """Write request headers""" r = self.request self.channel.write("%s %s\r\n" % (r.cmd, url.encode_url_string(r.headers)))