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

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Quote string, escaping non-printables

src/r/d/rdiff-backup-HEAD/rdiff_backup/eas_acls.py   rdiff-backup(Download)
def EA2Record(ea):
	"""Convert ExtendedAttributes object to text record"""
	str_list = ['# file: %s' % C.acl_quote(ea.get_indexpath())]
	for (name, val) in ea.attr_dict.iteritems():
		if not val: str_list.append(name)
		else:
			encoded_val = base64.encodestring(val).replace('\n', '')
			try:
				str_list.append('%s=0s%s' % (C.acl_quote(name), encoded_val))
def ACL2Record(acl):
	"""Convert an AccessControlLists object into a text record"""
	return '# file: %s\n%s\n' % (C.acl_quote(acl.get_indexpath()), str(acl))
 
def Record2ACL(record):

src/r/d/rdiff-backup-HEAD/rdiff_backup/win_acls.py   rdiff-backup(Download)
	def __str__(self):
		return '# file: %s\n%s\n' % \
				(C.acl_quote(self.get_indexpath()), unicode(self.__acl))
 
	def from_string(self, acl_str):