--- /dev/null
+# FritzCall plugin german localization
+# Copyright (C) 2008 Michael Schmidt
+# This file is distributed under the same license as the PACKAGE package.
+# Michael Schmidt <michael@schmidt-schmitten.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Enigma2 FritzCall Plugin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-22 11:54+0200\n"
+"PO-Revision-Date: 2008-06-22 11:57+0200\n"
+"Last-Translator: Michael Schmidt <michael@schmidt-schmitten.com>\n"
+"Language-Team: german <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../plugin.py:45
+msgid "Flash"
+msgstr "Flash"
+
+#: ../plugin.py:45
+msgid "USB Stick"
+msgstr "USB Stick"
+
+#: ../plugin.py:45
+msgid "CF Drive"
+msgstr "CF Laufwerk"
+
+#: ../plugin.py:45
+msgid "Harddisk"
+msgstr "Festplatte"
+
+#: ../plugin.py:67
+#, python-format
+msgid "Fritz!Box Login failed! - Error: %s"
+msgstr "Fritz!Box Login fehlgeschlagen! - Fehler: %s"
+
+#: ../plugin.py:71
+#, python-format
+msgid "Could not load phonebook from Fritz!Box - Error: %s"
+msgstr "Konnte Telefonbuch nicht von Fritz!Box laden - Fehler: %s"
+
+#: ../plugin.py:109
+msgid "mobile"
+msgstr "mobil"
+
+#: ../plugin.py:111
+msgid "home"
+msgstr "privat"
+
+#: ../plugin.py:113
+msgid "work"
+msgstr "geschäftlich"
+
+#: ../plugin.py:116 ../plugin.py:137
+msgid "Shortcut"
+msgstr "Kurzwahl"
+
+#: ../plugin.py:118 ../plugin.py:139
+msgid "Vanity"
+msgstr "Vanity"
+
+#: ../plugin.py:144
+msgid "Could not parse Fritz!Box Phonebook entry"
+msgstr "Konnte Eintrag in Frritz!Box-Telefonbuch nicht lesen"
+
+#: ../plugin.py:186
+msgid "Fritz!Box Login failed! - Wrong Password!"
+msgstr "Fritz!Box Login fehlgeschlagen! - Falsches Passwort"
+
+#: ../plugin.py:261
+msgid "You need to enable the monitoring on your Fritz!Box by dialing #96*5*!"
+msgstr ""
+"Monitoring auf der Fritz!Box muss durch Wählen von #96*5* eingeschaltet "
+"werden!"
+
+#: ../plugin.py:265
+msgid "Cancel"
+msgstr "Abbruch"
+
+#: ../plugin.py:266
+msgid "OK"
+msgstr "OK"
+
+#: ../plugin.py:289
+msgid "Call monitoring"
+msgstr "Anrufanzeige"
+
+#: ../plugin.py:291
+msgid "Fritz!Box FON IP address"
+msgstr "Fritz!Box FON IP-Adresse"
+
+#: ../plugin.py:293
+msgid "Show Calls for specific MSN"
+msgstr "Zeige nur Anrufe bestimmter Nummern"
+
+#: ../plugin.py:295
+msgid "MSN to show"
+msgstr "anzuzeigende MSN"
+
+#: ../plugin.py:297
+msgid "Show Outgoing Calls"
+msgstr "Zeige ausgehende Anrufe an"
+
+#: ../plugin.py:298
+msgid "Timeout for Call Notifications (seconds)"
+msgstr "Anzeigedauer in Sekunden"
+
+#: ../plugin.py:299
+msgid "Reverse Lookup Caller ID (DE only)"
+msgstr "Rückwärtssuche (nur DE)"
+
+#: ../plugin.py:301
+msgid "Read PhoneBook from Fritz!Box"
+msgstr "Telefonbuch der Fritz!Box auslesen"
+
+#: ../plugin.py:303
+msgid "Password Accessing Fritz!Box"
+msgstr "Passwort der Fritz!Box"
+
+#: ../plugin.py:305
+msgid "Use internal PhoneBook"
+msgstr "Benutze internes Telefonbuch"
+
+#: ../plugin.py:307
+msgid "PhoneBook Location"
+msgstr "Speicherort des Telefonbuchs"
+
+#: ../plugin.py:308
+msgid "Automatically add new Caller to PhoneBook"
+msgstr "Anrufer automatisch dem Telefonbuch hinzufügen"
+
+#: ../plugin.py:310
+msgid "Strip Leading 0"
+msgstr "Führende 0 entfernen"
+
+#: ../plugin.py:311
+msgid "Prefix for Outgoing Calls"
+msgstr "Vorwahl für ausgehende Anrufe"
+
+#: ../plugin.py:326
+msgid "Can't create PhoneBook.txt"
+msgstr "Kann Phonebook.txt nicht anlegen"
+
+#: ../plugin.py:358 ../plugin.py:471
+#, python-format
+msgid ""
+"Incoming Call on %s from\n"
+"---------------------------------------------\n"
+"%s\n"
+"%s\n"
+"---------------------------------------------\n"
+"to: %s"
+msgstr ""
+"Eingehender Anruf um %s von\n"
+"---------------------------------------------\n"
+"%s\n"
+"%s\n"
+"---------------------------------------------\n"
+"an: %s"
+
+#: ../plugin.py:360 ../plugin.py:473
+#, python-format
+msgid ""
+"Outgoing Call on %s to\n"
+"---------------------------------------------\n"
+"%s\n"
+"%s\n"
+"---------------------------------------------\n"
+"from: %s"
+msgstr ""
+"Abgehender Anruf um %s an\n"
+"---------------------------------------------\n"
+"%s\n"
+"%s\n"
+"---------------------------------------------\n"
+"von: %s"
+
+#: ../plugin.py:425 ../plugin.py:452 ../plugin.py:514
+msgid "UNKNOWN"
+msgstr "UNBEKANNT"
+
+#: ../plugin.py:527
+msgid "Connecting to Fritz!Box..."
+msgstr "Verbinde mit Fritz!Box..."
+
+#: ../plugin.py:530
+msgid "Connected to Fritz!Box!"
+msgstr "Verbunden mit Fritz!Box!"
+
+#: ../plugin.py:536
+#, python-format
+msgid ""
+"Connection to Fritz!Box! lost\n"
+" (%s)\n"
+"retrying..."
+msgstr ""
+"Verbindung mit Fritz!Box verloren\n"
+" (%s)\n"
+"neuer Versuch..."
+
+#: ../plugin.py:540
+#, python-format
+msgid ""
+"Connecting to Fritz!Box failed\n"
+" (%s)\n"
+"retrying..."
+msgstr ""
+"Verbindung zur Fritz!Box fehlgeschlagen\n"
+" (%s)\n"
+"neuer Versuch..."
+
+#: ../plugin.py:588 ../plugin.py:591
+msgid "Display Fritzbox-Fon calls on screen"
+msgstr "Anzeige der Anrufe auf der Fritzbox-Fon"
+
+#~ msgid "Could not read Fritz!Box Phonebook"
+#~ msgstr "Konnte Fritz!Box-Telefonbuch nicht lesen"
from Components.ActionMap import ActionMap
from Components.Label import Label
+from Components.Button import Button
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigIP, ConfigEnableDisable, getConfigListEntry, ConfigText, ConfigInteger
from Components.ConfigList import ConfigListScreen
from twisted.web.client import getPage
from os import path as os_path
-from urllib import urlencode
+from urllib import urlencode
import re
import gettext
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS
try:
- _ = gettext.translation('fritzcall', '/usr/lib/enigma2/python/Plugins/Extensions/FritzCall/po', [config.osd.language.getText()]).gettext
+ _ = gettext.translation('FritzCall', resolveFilename(SCOPE_PLUGINS, "Extensions/FritzCall/locale"), [config.osd.language.getText()]).gettext
except IOError:
pass
config.plugins.FritzCall.fritzphonebook = ConfigEnableDisable(default = False)
config.plugins.FritzCall.phonebook = ConfigEnableDisable(default = False)
config.plugins.FritzCall.addcallers = ConfigEnableDisable(default = False)
-config.plugins.FritzCall.phonebookLocation = ConfigSelection(choices = [("/media/usb/PhoneBook.txt", _("USB Stick")), ("/media/cf/PhoneBook.txt", _("CF Drive")), ("/media/hdd/PhoneBook.txt", _("Harddisk"))])
+config.plugins.FritzCall.phonebookLocation = ConfigSelection(choices = [("/etc/enigma2/PhoneBook.txt", _("Flash")), ("/media/usb/PhoneBook.txt", _("USB Stick")), ("/media/cf/PhoneBook.txt", _("CF Drive")), ("/media/hdd/PhoneBook.txt", _("Harddisk"))])
config.plugins.FritzCall.password = ConfigText(default = "", fixed_size = False)
config.plugins.FritzCall.prefix = ConfigText(default = "", fixed_size = False)
name = found.group(1)
thisnumber = found.group(2)
if found.group(3):
- name = name + ", " + _("Kurzwahl") + ": " + found.group(3)
+ name = name + ", " + _("Shortcut") + ": " + found.group(3)
if found.group(4):
name = name + ", " +_("Vanity") +": " + found.group(4)
name = name.replace("&", "&").replace("ß", "ß").replace("ä", "ä").replace("ö", "ö").replace("ü", "ü").replace("Ä", "Ä").replace("Ö", "Ö").replace("Ü", "Ü")
def add(self, number, name):
print "[FritzCallPhonebook] add"
- if config.plugins.FritzCall.phonebook.value and config.plugins.FritzCall.addcallers.value:
+#===============================================================================
+# It could happen, that two reverseLookups are running in parallel,
+# so check first, whether we have already added the number to the phonebook.
+#===============================================================================
+ if phonebook.search(number) is None and number <> 0 and config.plugins.FritzCall.phonebook.value and config.plugins.FritzCall.addcallers.value:
try:
f = open(config.plugins.FritzCall.phonebookLocation.value, 'a')
name = name.strip() + "\n"
self.phonebook[number] = name;
f.write(string)
f.close()
+ print "[FritzCallPhonebook] added %s with %sto Phonebook.txt" %(number, name)
return True
except IOError:
<screen position="100,90" size="550,420" title="FritzCall Setup" >
<widget name="config" position="20,10" size="510,300" scrollbarMode="showOnDemand" />
<widget name="consideration" position="20,320" font="Regular;20" halign="center" size="510,50" />
+ <ePixmap position="135,375" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
+ <ePixmap position="275,375" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
+ <widget name="key_red" position="135,375" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+ <widget name="key_green" position="275,375" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
</screen>"""
def __init__(self, session, args = None):
self["consideration"] = Label(_("You need to enable the monitoring on your Fritz!Box by dialing #96*5*!"))
self.list = []
+ # Initialize Buttons
+ self["key_red"] = Button(_("Cancel"))
+ self["key_green"] = Button(_("OK"))
+
self["setupActions"] = ActionMap(["SetupActions"],
{
"save": self.save,
x[1].cancel()
self.close()
-class FritzProtocol(LineReceiver):
- def __init__(self):
-# print "[FritzProtocol] __init__"
- self.resetValues()
+#===============================================================================
+# We need a separate class for each invocation of reverseLookup to retain
+# the necessary data for the notification
+#===============================================================================
- def resetValues(self):
-# print "[FritzProtocol] resetValues"
- self.number = '0'
- self.caller = None
- self.phone = None
- self.date = '0'
+class FritzReverseLookupAndNotifier():
+ def __init__(self, event, number, caller, phone, date):
+ self.event = event
+ self.number = number
+ self.caller = caller
+ self.phone = phone
+ self.date = date
- def notify(self, text, timeout=config.plugins.FritzCall.timeout.value):
- Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_INFO, timeout=timeout)
-
- def handleIncoming(self):
-# print "[FritzProtocol] handle Incoming!"
-
- text = _("Incoming Call ")
- if self.caller is not None:
- text += _("on %s from\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nto: %s") % (self.date, self.number, self.caller, self.phone)
+ print "[FritzReverseLookupAndNotifier] reverse Lookup for %s!" %self.number
+ url = "http://www.dasoertliche.de/?form_name=search_inv&ph=%s" %self.number
+ getPage(url, method="GET").addCallback(self.gotPageDasOertliche).addErrback(self.gotErrorDasOertliche)
+
+ def notifyAndReset(self, timeout=config.plugins.FritzCall.timeout.value):
+ if self.event == "RING":
+ text = _("Incoming Call on %s from\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nto: %s") % (self.date, self.number, self.caller, self.phone)
else:
- text += _("on %s from\n---------------------------------------------\n%s (UNKNOWN)\n---------------------------------------------\nto: %s") % (self.date, self.number, self.phone)
+ text = _("Outgoing Call on %s to\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nfrom: %s") % (self.date, self.number, self.caller, self.phone)
+ print "[FritzReverseLookupAndNotifier] notifyAndReset:\n%s" %text
+ Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_INFO, timeout=timeout)
+ # at this point we could destroy the object, but I dunno how :-)
- self.notify(text)
- self.resetValues()
+ def gotErrorDasOertliche(self, error): # so we try Klicktel
+ url = "http://www.klicktel.de/telefonbuch/backwardssearch.html?newSearch=1&boxtype=backwards&vollstaendig=%s" %self.number
+ getPage(url, method="GET").addCallback(self.gotPageKlicktel).addErrback(self.gotErrorKlicktel)
- def handleOutgoing(self):
-# print "[FritzProtocol] handle Outgoing!"
- text = _("Outgoing Call ")
- if(self.caller is not None):
- text += _("on %s to\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nfrom: %s") % (self.date, self.number, self.caller, self.phone)
- else:
- text += _("on %s to\n---------------------------------------------\n%s (UNKNOWN)\n\n---------------------------------------------\nfrom: %s") % (self.date, self.number, self.phone)#
+ def gotPageDasOertliche(self, html):
+ print "[FritzReverseLookupAndNotifier] gotPageDasOertliche"
+ try:
+ 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-8859-1").encode("UTF-8")
+ text = re.sub("<.*?>", "", td) # remove tags and their content
+ text = text.split("\n")
+ #===============================================================================
+ #
+ # The logic here is as follows:
+ #
+ # The first line in the table, which has a word followed by a space
+ # followed by a word is the name. As of the time of writing that was line 3,
+ # but that could change in the future.
+ #
+ # Starting from the next line after that we are looking for a line
+ # containing 5 digits (PLZ) followed by a space followed by a word at the
+ # end of the line. If found, we assume, that that is the address. The right
+ # one at time of writing was 10.
+ #
+ #===============================================================================
+ nameLine = 3 # as of 08.06.08
+ if not re.search('\S+ \S+', text[nameLine].replace(" ", " ").strip()):
+ for i in range(0,len(text)-1):
+ if re.search('\S+ \S+', text[i].replace(" ", " ").strip()):
+ nameLine = i
+ break
+ name = text[nameLine].replace(" ", " ").strip()
+
+ addrLine = 10 # as of 08.06.08 that was the correct one
+ for i in range(nameLine+1,len(text)-1): # look for a line containing the address, i.e. "PLZ Name" at the end of the line
+ if re.search('\d\d\d\d\d \S+$', text[i].replace(" ", " ").strip()):
+ addrLine = i
+ break
+ address = text[addrLine].replace(" ", " ").replace(", ", "\n").strip();
+ print "[FritzReverseLookupAndNotifier] Reverse lookup succeeded with DasOertliche:\nName: %s\n\nAddress: %s" %(name, address)
+
+ self.caller = "%s\n%s" %(name, address)
+
+ if self.event == "RING":
+ phonebook.add(self.number, self.caller.replace("\n", ", "))
- self.notify(text)
- self.resetValues()
+ self.notifyAndReset()
+ return
- def handleEvent(self):
-# print "[FritzProtocol] handleEvent!"
- if self.event == "RING":
- self.handleIncoming()
- elif self.event == "CALL":
- self.handleOutgoing()
+ except:
+ import traceback, sys
+ traceback.print_exc(file=sys.stdout)
+ #raise e
- def handleEventOnError(self, error):
-# print "[FritzProtocol] handleEventOnError - Error :%s" %error
- self.handleEvent()
+ url = "http://www.klicktel.de/telefonbuch/backwardssearch.html?newSearch=1&boxtype=backwards&vollstaendig=%s" %self.number
+ getPage(url, method="GET").addCallback(self.gotPageKlicktel).addErrback(self.gotErrorKlicktel)
- def _gotPage(self, data):
-# print "[FritzProtocol] _gotPage"
+ def gotErrorKlicktel(self, error):
+ self.caller = _("UNKNOWN")
+ self.notifyAndReset()
+
+ def gotPageKlicktel(self, html):
+ print "[FritzReverseLookupAndNotifier] gotPageKlicktel"
try:
- self.gotPage(data)
+ html.decode("ISO-8859-1").encode("UTF-8")
+ html = html.replace("<br />", ", ")
+ found = re.match('.*<a class="head" href=".*" title=""><span class="title">(.*)</span></a>.*<span class="location">([\S ,]+)</span>', html, re.S)
+ if found:
+ name = found.group(1)
+ address = found.group(2)
+ print "[FritzProtocol] Reverse lookup succeeded with Klicktel:\nName: %s\n\nAddress: %s" %(name, address)
+
+ self.caller = "%s\n%s" %(name, address)
+
+ if self.event == "RING":
+ phonebook.add(self.number, self.caller.replace("\n", ", "))
+
+ self.notifyAndReset()
+ return True
+
except:
import traceback, sys
traceback.print_exc(file=sys.stdout)
#raise e
- self.handleEvent()
-
- def gotPage(self, html):
-# print "[FritzProtocol] gotPage"
- 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-8859-1").encode("UTF-8")
- text = re.sub("<.*?>", "", td) # remove tags and their content
- text = text.split("\n")
- #===============================================================================
- #
- # The logic here is as follows:
- #
- # The first line in the table, which has a word followed by a space
- # followed by a word is the name. As of the time of writing that was line 3,
- # but that could change in the future.
- #
- # Starting from the next line after that we are looking for a line
- # containing 5 digits (PLZ) followed by a space followed by a word at the
- # end of the line. If found, we assume, that that is the address. The right
- # one at time of writing was 10.
- #
- #===============================================================================
- nameLine = 3 # as of 08.06.08
- if not re.search('\S+ \S+', text[nameLine].replace(" ", " ").strip()):
- for i in range(0,len(text)-1):
- if re.search('\S+ \S+', text[i].replace(" ", " ").strip()):
- nameLine = i
- break
- name = text[nameLine].replace(" ", " ").strip()
- addrLine = 10 # as of 08.06.08 that was the correct one
- for i in range(nameLine+1,len(text)-1): # look for a line containing the address, i.e. "PLZ Name" at the end of the line
- if re.search('\d\d\d\d\d \S+$', text[i].replace(" ", " ").strip()):
- addrLine = i
- break
- address = text[addrLine].replace(" ", " ").replace(", ", "\n").strip();
- print "[FritzProtocol] Reverse lookup succeeded:\nName: %s\n\nAddress: %s" %(name, address)
+ self.caller = _("UNKNOWN")
+ self.notifyAndReset()
- self.caller = "%s\n%s" %(name, address)
+
- #Autoadd to PhoneBook.txt if enabled
- if config.plugins.FritzCall.addcallers.value and self.event == "RING":
- phonebook.add(self.number, self.caller.replace("\n", ", "))
-# else:
-# print "[FritzProtocol] Reverse lookup without result!"
+class FritzProtocol(LineReceiver):
+ def __init__(self):
+ print "[FritzProtocol] __init__"
+ self.resetValues()
- self.handleEvent()
+ def resetValues(self):
+ print "[FritzProtocol] resetValues"
+ self.number = '0'
+ self.caller = None
+ self.phone = None
+ self.date = '0'
- def reverseLookup(self):
-# print "[FritzProtocol] reverse Lookup!"
- url = "http://www.dasoertliche.de/?form_name=search_inv&ph=%s" %self.number
- getPage(url,method="GET").addCallback(self._gotPage).addErrback(self.handleEventOnError)
+ def notifyAndReset(self, timeout=config.plugins.FritzCall.timeout.value):
+ if self.event == "RING":
+ text = _("Incoming Call on %s from\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nto: %s") % (self.date, self.number, self.caller, self.phone)
+ else:
+ text = _("Outgoing Call on %s to\n---------------------------------------------\n%s\n%s\n---------------------------------------------\nfrom: %s") % (self.date, self.number, self.caller, self.phone)
+ print "[FritzProtocol] notifyAndReset:\n%s" %text
+ Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_INFO, timeout=timeout)
+ self.resetValues()
def lineReceived(self, line):
-# print "[FritzProtocol] lineReceived"
-#15.07.06 00:38:54;CALL;1;4;<provider>;<callee>;
+ print "[FritzProtocol] lineReceived: %s" %line
+#15.07.06 00:38:54;CALL;1;4;<from/extern>;<to/our msn>;
#15.07.06 00:38:58;DISCONNECT;1;0;
-#15.07.06 00:39:22;RING;0;<caller>;<outgoing msn>;
+#15.07.06 00:39:22;RING;0;<from/extern>;<to/our msn>;
#15.07.06 00:39:27;DISCONNECT;0;0;
a = line.split(';')
(self.date, self.event) = a[0:2]
- #incoming Call
- if self.event == "RING":
- phone = a[4]
-
- if not config.plugins.FritzCall.filter.value or config.plugins.FritzCall.filtermsn.value == phone:
- phonename = phonebook.search(phone)
- if phonename is not None:
- self.phone = "%s (%s)" %(phone, phonename)
- else:
- self.phone = phone
-
- if config.plugins.FritzCall.internal.value and len(a[3]) > 3 and a[3][0]=="0":
- self.number = a[3][1:]
- else:
- self.number = a[3]
-
- self.caller = phonebook.search(self.number)
- if (self.caller is None) and config.plugins.FritzCall.lookup.value:
- self.reverseLookup()
- else:
- self.handleEvent()
-
- #Outgoing Call
- elif config.plugins.FritzCall.showOutgoing.value and self.event == "CALL":
+ if self.event == "RING" or (self.event == "CALL" and config.plugins.FritzCall.showOutgoing.value):
phone = a[4]
+ number = (a[3] if self.event == "RING" else a[5])
- if not config.plugins.FritzCall.filter.value or config.plugins.FritzCall.filtermsn.value == phone:
- phonename = phonebook.search(phone)
+ if not (config.plugins.FritzCall.filter.value and config.plugins.FritzCall.filtermsn.value == phone):
+ phonename = phonebook.search(phone) # do we have a name for the number of our side?
if phonename is not None:
self.phone = "%s (%s)" %(phone, phonename)
else:
self.phone = phone
- if config.plugins.FritzCall.internal.value and len(a[5]) > 3 and a[5][0]=="0":
- self.number = a[5][1:]
+ if config.plugins.FritzCall.internal.value and len(number) > 3 and number[0]=="0":
+ self.number = number[1:]
else:
- self.number = a[5]
+ self.number = number
- if self.number[0] != '0':
+ if self.event == "CALL" and self.number[0] != '0': # should only happen for outgoing
self.number = config.plugins.FritzCall.prefix.value + self.number
- self.caller = phonebook.search(self.number)
+ if self.number is not "":
+ self.caller = phonebook.search(self.number)
+ if (self.caller is None) and config.plugins.FritzCall.lookup.value:
+ FritzReverseLookupAndNotifier(self.event, self.number, self.caller, self.phone, self.date)
+ return # reverselookup is supposed to handle the message itself
- if (self.caller is None) and config.plugins.FritzCall.lookup.value:
- self.reverseLookup()
- else:
- self.handleEvent()
+ if self.caller is None:
+ self.caller = _("UNKNOWN")
+
+ self.notifyAndReset()
class FritzClientFactory(ReconnectingClientFactory):
fritz_call = None
def Plugins(**kwargs):
- return [ PluginDescriptor(name="FritzCall", description=_("Display Fritzbox-Fon calls on screen"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
- PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart) ]
+ if os_path.exists("plugin.png"):
+ return [ PluginDescriptor(name="FritzCall", description=_("Display Fritzbox-Fon calls on screen"), where = PluginDescriptor.WHERE_PLUGINMENU, icon = "plugin.png", fnc=main),
+ PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart) ]
+ else:
+ return [ PluginDescriptor(name="FritzCall", description=_("Display Fritzbox-Fon calls on screen"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
+ PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart) ]
+
\ No newline at end of file