Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
Convert python long to 7 byte string

src/r/d/rdiff-backup-HEAD/rdiff_backup/iterfile.py   rdiff-backup(Download)
				pickle = cPickle.dumps(currentobj, 1)
				self.array_buf.fromstring("o")
				self.array_buf.fromstring(C.long2str(long(len(pickle))))
				self.array_buf.fromstring(pickle)
		return 1
			self.currently_in_file = None
			excstr = cPickle.dumps(self.last_exception, 1)
			total = "".join(('e', C.long2str(long(len(excstr))), excstr))
		else:
			total = "".join((prefix_letter, C.long2str(long(len(buf))), buf))
			if buf == "": # end of file
				cstr = cPickle.dumps(self.currently_in_file.close(), 1)
				self.currently_in_file = None
				total += "".join(('h', C.long2str(long(len(cstr))), cstr))
	def add_misc(self, obj):
		"""Add an arbitrary pickleable object to the buffer"""
		pickle = cPickle.dumps(obj, 1)
		self.array_buf.fromstring("o")
		self.array_buf.fromstring(C.long2str(long(len(pickle))))

src/r/d/rdiff-backup-HEAD/rdiff_backup/connection.py   rdiff-backup(Download)
	def _write(self, headerchar, data, req_num):
		"""Write header and then data to the pipe"""
		try:
			self.outpipe.write(headerchar + chr(req_num) +
							   C.long2str(long(len(data))))