*do not write debugfile (no ones needs this anymore)
authorStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Tue, 11 Sep 2007 22:05:42 +0000 (22:05 +0000)
committerStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Tue, 11 Sep 2007 22:05:42 +0000 (22:05 +0000)
*set UTF-8 encoding for result of reverse lookup (should fix problems with german Umlauts).

fritzcall/src/plugin.py

index aefeb17..7247f54 100644 (file)
@@ -330,12 +330,10 @@ class FritzProtocol(LineReceiver):
        
        def gotPage(self, html):
 #              print "[FritzProtocol] gotPage"
-               f = open("/tmp/reverseLookup.html", "w")
-               f.write(html)
-               f.close()
                found = re.match('.*<td.*?class="cel-data border.*?>(.*?)</td>', html, re.S)
                if found:                                                                       
                        td = found.group(1)                                     # group(1) is the content of (.*?) in our pattern
+                       td.decode("ISO-88-59-1").encode("UTF-8")
                        text = re.sub("<.*?>", "", td)          # remove tags and their content
                        text = text.split("\n")