From 3f20222206bd50bab2d898f3eae0d26e96a32cce Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Sun, 24 Jul 2011 22:10:43 +0200 Subject: [PATCH] FIX for latest problems with labor version --- fritzcall/src/nrzuname.py | 10 +++++----- fritzcall/src/plugin.py | 25 +++++++++++++------------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/fritzcall/src/nrzuname.py b/fritzcall/src/nrzuname.py index 3aecb1d0..4746c2f9 100644 --- a/fritzcall/src/nrzuname.py +++ b/fritzcall/src/nrzuname.py @@ -1,10 +1,10 @@ #!/usr/bin/python # -*- coding: UTF-8 -*- ''' -$Id$ -$Author$ -$Revision$ -$Date$ +$Id: nrzuname.py 649 2011-07-03 14:16:49Z michael $ +$Author: michael $ +$Revision: 649 $ +$Date: 2011-07-03 16:16:49 +0200 (So, 03 Jul 2011) $ ''' import re, sys, os @@ -26,7 +26,7 @@ except ValueError: print message import htmlentitydefs -def html2unicode(in_html, charset): +def html2unicode(in_html): #=============================================================================== # # sanity checks # try: diff --git a/fritzcall/src/plugin.py b/fritzcall/src/plugin.py index fd9dbcfc..fa4bbea4 100644 --- a/fritzcall/src/plugin.py +++ b/fritzcall/src/plugin.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- ''' $Author: michael $ -$Revision: 646 $ -$Date: 2011-06-05 12:26:00 +0200 (So, 05 Jun 2011) $ -$Id: plugin.py 646 2011-06-05 10:26:00Z michael $ +$Revision: 650 $ +$Date: 2011-07-03 16:23:41 +0200 (So, 03 Jul 2011) $ +$Id: plugin.py 650 2011-07-03 14:23:41Z michael $ ''' from Screens.Screen import Screen from Screens.MessageBox import MessageBox @@ -292,8 +292,8 @@ class FritzAbout(Screen): self["text"] = Label( "FritzCall Plugin" + "\n\n" + "$Author: michael $"[1:-2] + "\n" + - "$Revision: 646 $"[1:-2] + "\n" + - "$Date: 2011-06-05 12:26:00 +0200 (So, 05 Jun 2011) $"[1:23] + "\n" + "$Revision: 650 $"[1:-2] + "\n" + + "$Date: 2011-07-03 16:23:41 +0200 (So, 03 Jul 2011) $"[1:23] + "\n" ) self["url"] = Label("http://wiki.blue-panel.com/index.php/FritzCall") self.onLayoutFinish.append(self.setWindowTitle) @@ -512,17 +512,16 @@ class FritzCallFBF: if found: charset = found.group(1) debug("[FritzCallFBF] _parseFritzBoxPhonebook: found charset: " + charset) - if charset != "utf-8": - html = html2unicode(html.decode(charset), charset).encode('utf-8') # this looks silly, but has to be + html = html2unicode(html.replace(chr(0xf6),'').decode(charset)).encode('utf-8') else: # this is kind of emergency conversion... try: debug("[FritzCallFBF] _parseFritzBoxPhonebook: try charset utf-8") charset = 'utf-8' - html = html2unicode(html.decode('utf-8'), 'utf-8').encode('utf-8') # this looks silly, but has to be + html = html2unicode(html.decode('utf-8')).encode('utf-8') # this looks silly, but has to be except UnicodeDecodeError: debug("[FritzCallFBF] _parseFritzBoxPhonebook: try charset iso-8859-1") charset = 'iso-8859-1' - html = html2unicode(html.decode('iso-8859-1'), 'iso-8859-1').encode('utf-8') # this looks silly, but has to be + html = html2unicode(html.decode('iso-8859-1')).encode('utf-8') # this looks silly, but has to be # if re.search('document.write\(TrFon1\(\)', html): if html.find('document.write(TrFon1()') != -1: @@ -534,6 +533,8 @@ class FritzCallFBF: # TrFonName(Entry umber, Name, ???, Path to picture) # followed by several lines with # TrFonNr(Type,Number,Shortcut,Vanity), which all belong to the name in TrFonName. + # + # Photo could be fetched with http://192.168.0.1/lua/photo.lua?photo=', html, re.S) @@ -751,7 +752,7 @@ class FritzCallFBF: debug("[FritzCallFBF] _gotPageCalls: filtermsns %s" % (repr(filtermsns))) # Typ;Datum;Name;Rufnummer;Nebenstelle;Eigene Rufnummer;Dauer - # 0 ;1 ;2 ;3 ;4 ;5 ;6 + # 0 ;1 ;2 ;3 ;4 ;5 ;6 lines = map(lambda line: line.split(';'), lines) lines = filter(lambda line: (len(line)==7 and (line[0]=="Typ" or self._callType == '.' or line[0] == self._callType)), lines) @@ -2720,7 +2721,7 @@ class FritzCallSetup(Screen, ConfigListScreen, HelpableScreen): def setWindowTitle(self): # TRANSLATORS: this is a window title. - self.setTitle(_("FritzCall Setup") + " (" + "$Revision: 646 $"[1: - 1] + "$Date: 2011-06-05 12:26:00 +0200 (So, 05 Jun 2011) $"[7:23] + ")") + self.setTitle(_("FritzCall Setup") + " (" + "$Revision: 650 $"[1: - 1] + "$Date: 2011-07-03 16:23:41 +0200 (So, 03 Jul 2011) $"[7:23] + ")") def keyLeft(self): ConfigListScreen.keyLeft(self) @@ -3184,7 +3185,7 @@ class FritzReverseLookupAndNotifier: class FritzProtocol(LineReceiver): def __init__(self): - debug("[FritzProtocol] " + "$Revision: 646 $"[1:-1] + "$Date: 2011-06-05 12:26:00 +0200 (So, 05 Jun 2011) $"[7:23] + " starting") + debug("[FritzProtocol] " + "$Revision: 650 $"[1:-1] + "$Date: 2011-07-03 16:23:41 +0200 (So, 03 Jul 2011) $"[7:23] + " starting") global mutedOnConnID mutedOnConnID = None self.number = '0' -- 2.20.1