[Frugalware-darcs] darcs-hooks: remove accents, just like the old wrapper did

VMiklos vmiklos at frugalware.org
Fri Jun 8 02:07:25 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=darcs-hooks;a=darcs_commitdiff;h=20070608000627-e2957-c817031cdc0d735f3418cfc2dfe7f8f6c0c94a1b.gz;

[remove accents, just like the old wrapper did
VMiklos <vmiklos at frugalware.org>**20070608000627] {
hunk ./darcs-hooks.py 2
+# -*- coding: iso-8859-2 -*-
hunk ./darcs-hooks.py 33
-			xmldoc = self.getxml('darcs chan --from-match "hash %s" --xml-output' % oldhash)
+			xmldoc = self.getxml('DARCS_DONT_ESCAPE_ISPRINT=1 darcs chan --from-match "hash %s" --xml-output' % oldhash)
hunk ./darcs-hooks.py 49
-		xmldoc = minidom.parseString(xmldata)
+		xmldoc = minidom.parseString(self.unaccent(xmldata))
hunk ./darcs-hooks.py 52
+	def unaccent(self, s):
+		ret = []
+		fro = "AEIOOOUUUaeiooouuu"
+		to = "AEIOOOUUUaeiooouuu"
+		for i in s:
+			if i in fro:
+				ret.append(to[fro.index(i)])
+			else:
+				ret.append(i)
+		return "".join(ret)
+
hunk ./sendmail/sendmail.py 2
+# -*- coding: iso-8859-2 -*-
hunk ./sendmail/sendmail.py 11
-	data = "".join(sock.readlines())
+	data = unaccent("".join(sock.readlines()))
hunk ./sendmail/sendmail.py 15
+def unaccent(s):
+	ret = []
+	fro = "AEIOOOUUUaeiooouuu"
+	to = "AEIOOOUUUaeiooouuu"
+	for i in s:
+		if i in fro:
+			ret.append(to[fro.index(i)])
+		else:
+			ret.append(i)
+	return "".join(ret)
+
}


More information about the Frugalware-darcs mailing list