Esempio n. 1
0
		def cbCreateOpen(rsp):
			value = {
					'username': self.username,
					'filename': self.filename
					}
			value.update(rsp.headers)
			return url.encode_url_string(value)
Esempio n. 2
0
	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)
Esempio n. 3
0
		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)
Esempio n. 4
0
	def submitHeaders(self):
		"""Write request headers"""
		r = self.request
		self.channel.write("%s %s\r\n" % (r.cmd, url.encode_url_string(r.headers)))