From 37a956a7474ff8c822cfde5f2f280b342428d460 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 9 Sep 2008 08:06:50 +0000 Subject: [PATCH] - Added choices to the list with calls from the FBF: all, in, missed, out - change in reverselookup.xml for tel.search.ch --- fritzcall/po/FritzCall.pot | 123 ++++++-------- fritzcall/po/de.po | 134 +++++++-------- fritzcall/po/it.po | 72 ++++++-- fritzcall/src/plugin.py | 280 +++++++++++++++++++++++--------- fritzcall/src/reverselookup.xml | 21 ++- 5 files changed, 387 insertions(+), 243 deletions(-) diff --git a/fritzcall/po/FritzCall.pot b/fritzcall/po/FritzCall.pot index c9eb1927..26dba338 100644 --- a/fritzcall/po/FritzCall.pot +++ b/fritzcall/po/FritzCall.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-19 08:31+0200\n" +"POT-Creation-Date: 2008-09-08 08:41+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,51 +16,47 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ../plugin.py:517 +#. TRANSLATORS: keep it short, this is a button +msgid "All" +msgstr "" + +msgid "All calls" +msgstr "" + msgid "Append shortcut number" msgstr "" -#: ../plugin.py:516 msgid "Append type of number" msgstr "" -#: ../plugin.py:518 msgid "Append vanity name" msgstr "" -#: ../plugin.py:507 msgid "Areacode to add to Outgoing Calls (if necessary)" msgstr "" -#: ../plugin.py:62 msgid "Austria" msgstr "" -#: ../plugin.py:523 msgid "Automatically add new Caller to PhoneBook" msgstr "" -#: ../plugin.py:50 msgid "CF Drive" msgstr "" -#: ../plugin.py:495 msgid "Call monitoring" msgstr "" -#: ../plugin.py:540 msgid "Can't create PhoneBook.txt" msgstr "" -#: ../plugin.py:467 +#. TRANSLATORS: keep it short, this is a button msgid "Cancel" msgstr "" -#: ../plugin.py:879 msgid "Connected to FRITZ!Box!" msgstr "" -#: ../plugin.py:889 #, python-format msgid "" "Connecting to FRITZ!Box failed\n" @@ -68,11 +64,9 @@ msgid "" "retrying..." msgstr "" -#: ../plugin.py:876 msgid "Connecting to FRITZ!Box..." msgstr "" -#: ../plugin.py:885 #, python-format msgid "" "Connection to FRITZ!Box! lost\n" @@ -80,66 +74,55 @@ msgid "" "retrying..." msgstr "" -#: ../plugin.py:238 #, python-format -msgid "Could not load missed calls from FRITZ!Box - Error: %s" +msgid "Could not load calls from FRITZ!Box - Error: %s" msgstr "" -#: ../plugin.py:136 #, python-format msgid "Could not load phonebook from FRITZ!Box - Error: %s" msgstr "" -#: ../plugin.py:235 msgid "Could not parse FRITZ!Box Phonebook entry" msgstr "" -#: ../plugin.py:511 msgid "Country" msgstr "" -#: ../plugin.py:939 msgid "Display FRITZ!box-Fon calls on screen" msgstr "" -#: ../plugin.py:497 msgid "FRITZ!Box FON IP address" msgstr "" -#: ../plugin.py:103 #, python-format msgid "FRITZ!Box Login failed! - Error: %s" msgstr "" -#: ../plugin.py:113 msgid "FRITZ!Box Login failed! - Wrong Password!" msgstr "" -#: ../plugin.py:50 msgid "Flash" msgstr "" -#: ../plugin.py:59 msgid "France" msgstr "" -#: ../plugin.py:456 msgid "FritzCall Setup" msgstr "" -#: ../plugin.py:63 msgid "Germany" msgstr "" -#: ../plugin.py:348 -msgid "Getting missed calls from FRITZ!Box..." +msgid "Getting calls from FRITZ!Box..." msgstr "" -#: ../plugin.py:50 msgid "Harddisk" msgstr "" -#: ../plugin.py:622 +#. TRANSLATORS: keep it short, this is a button +msgid "Incoming" +msgstr "" + #, python-format msgid "" "Incoming Call on %(date)s from\n" @@ -150,35 +133,33 @@ msgid "" "to: %(phone)s" msgstr "" -#: ../plugin.py:60 +msgid "Incoming calls" +msgstr "" + msgid "Italy" msgstr "" -#: ../plugin.py:581 msgid "Last 10 calls:\n" msgstr "" -#: ../plugin.py:503 msgid "MSN to show (separated by ,)" msgstr "" -#: ../plugin.py:469 -msgid "Missed Calls" +#. TRANSLATORS: keep it short, this is a button +msgid "Missed" msgstr "" -#: ../plugin.py:331 ../plugin.py:366 ../plugin.py:940 msgid "Missed calls" msgstr "" -#: ../plugin.py:352 -msgid "Missed calls during Standby" +#. TRANSLATORS: keep it short, this is a button +msgid "OK" msgstr "" -#: ../plugin.py:468 -msgid "OK" +#. TRANSLATORS: keep it short, this is a button +msgid "Outgoing" msgstr "" -#: ../plugin.py:624 #, python-format msgid "" "Outgoing Call on %(date)s to\n" @@ -189,104 +170,106 @@ msgid "" "from: %(phone)s" msgstr "" -#: ../plugin.py:513 +msgid "Outgoing calls" +msgstr "" + msgid "Password Accessing FRITZ!Box" msgstr "" -#: ../plugin.py:522 +#. TRANSLATORS: keep it short, this is a button +msgid "Phone calls" +msgstr "" + msgid "PhoneBook Location" msgstr "" -#: ../plugin.py:514 msgid "Read PhoneBook from FRITZ!Box" msgstr "" -#: ../plugin.py:509 msgid "Reverse Lookup Caller ID (select country below)" msgstr "" -#: ../plugin.py:200 ../plugin.py:224 msgid "Shortcut" msgstr "" -#: ../plugin.py:501 msgid "Show Calls for specific MSN" msgstr "" -#: ../plugin.py:505 msgid "Show Outgoing Calls" msgstr "" -#: ../plugin.py:499 msgid "Show after Standby" msgstr "" -#: ../plugin.py:525 msgid "Strip Leading 0" msgstr "" -#: ../plugin.py:61 msgid "Switzerland" msgstr "" -#: ../plugin.py:58 msgid "The Netherlands" msgstr "" -#: ../plugin.py:508 msgid "Timeout for Call Notifications (seconds)" msgstr "" -#: ../plugin.py:252 ../plugin.py:596 ../plugin.py:670 ../plugin.py:683 -#: ../plugin.py:694 ../plugin.py:708 ../plugin.py:727 ../plugin.py:781 -#: ../plugin.py:864 msgid "UNKNOWN" msgstr "" -#: ../plugin.py:50 msgid "USB Stick" msgstr "" -#: ../plugin.py:520 msgid "Use internal PhoneBook" msgstr "" -#: ../plugin.py:202 ../plugin.py:226 msgid "Vanity" msgstr "" -#: ../plugin.py:463 msgid "You need to enable the monitoring on your FRITZ!Box by dialing #96*5*!" msgstr "" -#: ../plugin.py:259 msgid "" "You need to set the password of the FRITZ!Box\n" -"in the configuration dialog to display missed calls\n" +"in the configuration dialog to display calls\n" "\n" "It could be a communication issue, just try again." msgstr "" -#: ../plugin.py:195 +msgid "done" +msgstr "" + +msgid "done, using last list" +msgstr "" + +msgid "finishing" +msgstr "" + msgid "home" msgstr "" -#: ../plugin.py:193 +msgid "login" +msgstr "" + +msgid "login ok" +msgstr "" + +msgid "login verification" +msgstr "" + msgid "mobile" msgstr "" -#: ../plugin.py:40 +msgid "preparing" +msgstr "" + msgid "show as list" msgstr "" -#: ../plugin.py:40 msgid "show each call" msgstr "" -#: ../plugin.py:40 msgid "show nothing" msgstr "" -#: ../plugin.py:197 msgid "work" msgstr "" diff --git a/fritzcall/po/de.po b/fritzcall/po/de.po index 12cb6f83..906852b3 100644 --- a/fritzcall/po/de.po +++ b/fritzcall/po/de.po @@ -7,59 +7,55 @@ msgid "" msgstr "" "Project-Id-Version: Enigma2 FritzCall Plugin\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-19 08:28+0200\n" -"PO-Revision-Date: 2008-08-19 08:29+0200\n" +"POT-Creation-Date: 2008-09-07 19:04+0200\n" +"PO-Revision-Date: 2008-09-07 19:09+0200\n" "Last-Translator: Michael Schmidt \n" "Language-Team: german \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../plugin.py:517 +#. TRANSLATORS: keep it short, this is a button +msgid "All" +msgstr "Alle" + +msgid "All calls" +msgstr "Alle Anrufe" + msgid "Append shortcut number" msgstr "Füge Kurzwahl an" -#: ../plugin.py:516 msgid "Append type of number" msgstr "Füge Typ der Nummer an" -#: ../plugin.py:518 msgid "Append vanity name" msgstr "Füge Vanity-Nummer an" -#: ../plugin.py:507 msgid "Areacode to add to Outgoing Calls (if necessary)" -msgstr "Vorwahl für ausgehende Anrufe (falls nötig)" +msgstr "Vorwahl für abgehende Anrufe (falls nötig)" -#: ../plugin.py:62 msgid "Austria" msgstr "Österreich" -#: ../plugin.py:523 msgid "Automatically add new Caller to PhoneBook" msgstr "Anrufer automatisch dem Telefonbuch hinzufügen" -#: ../plugin.py:50 msgid "CF Drive" msgstr "CF Laufwerk" -#: ../plugin.py:495 msgid "Call monitoring" msgstr "Anrufanzeige" -#: ../plugin.py:540 msgid "Can't create PhoneBook.txt" msgstr "Kann Phonebook.txt nicht anlegen" -#: ../plugin.py:467 +#. TRANSLATORS: keep it short, this is a button msgid "Cancel" msgstr "Abbruch" -#: ../plugin.py:879 msgid "Connected to FRITZ!Box!" msgstr "Verbunden mit FRITZ!Box!" -#: ../plugin.py:889 #, python-format msgid "" "Connecting to FRITZ!Box failed\n" @@ -70,11 +66,9 @@ msgstr "" " (%s)\n" "neuer Versuch..." -#: ../plugin.py:876 msgid "Connecting to FRITZ!Box..." msgstr "Verbinde mit FRITZ!Box..." -#: ../plugin.py:885 #, python-format msgid "" "Connection to FRITZ!Box! lost\n" @@ -85,66 +79,55 @@ msgstr "" " (%s)\n" "neuer Versuch..." -#: ../plugin.py:238 #, python-format -msgid "Could not load missed calls from FRITZ!Box - Error: %s" +msgid "Could not load calls from FRITZ!Box - Error: %s" msgstr "Konnte verpasste Anrufe nicht von FRITZ!Box laden - Fehler: %s" -#: ../plugin.py:136 #, python-format msgid "Could not load phonebook from FRITZ!Box - Error: %s" msgstr "Konnte Telefonbuch nicht von FRITZ!Box laden - Fehler: %s" -#: ../plugin.py:235 msgid "Could not parse FRITZ!Box Phonebook entry" msgstr "Konnte Eintrag in FRITZ!Box-Telefonbuch nicht lesen" -#: ../plugin.py:511 msgid "Country" msgstr "Land" -#: ../plugin.py:939 msgid "Display FRITZ!box-Fon calls on screen" msgstr "Anzeige der Anrufe auf der FRITZ!Box Fon" -#: ../plugin.py:497 msgid "FRITZ!Box FON IP address" msgstr "FRITZ!Box FON IP-Adresse" -#: ../plugin.py:103 #, python-format msgid "FRITZ!Box Login failed! - Error: %s" msgstr "FRITZ!Box Login fehlgeschlagen! - Fehler: %s" -#: ../plugin.py:113 msgid "FRITZ!Box Login failed! - Wrong Password!" msgstr "FRITZ!Box Login fehlgeschlagen! - Falsches Passwort" -#: ../plugin.py:50 msgid "Flash" msgstr "Flash" -#: ../plugin.py:59 msgid "France" msgstr "Frankreich" -#: ../plugin.py:456 msgid "FritzCall Setup" msgstr "FritzCall Einstellungen" -#: ../plugin.py:63 msgid "Germany" msgstr "Deutschland" -#: ../plugin.py:348 -msgid "Getting missed calls from FRITZ!Box..." -msgstr "Hole die Liste verpasster Anrufe von der FRITZ!Box..." +msgid "Getting calls from FRITZ!Box..." +msgstr "Hole Liste der Anrufe von der FRITZ!Box..." -#: ../plugin.py:50 msgid "Harddisk" msgstr "Festplatte" -#: ../plugin.py:622 +#. TRANSLATORS: keep it short, this is a button +msgid "Incoming" +msgstr "Eingehend" + #, python-format msgid "" "Incoming Call on %(date)s from\n" @@ -161,36 +144,33 @@ msgstr "" "---------------------------------------------\n" "an: %(phone)s" -#: ../plugin.py:60 +msgid "Incoming calls" +msgstr "Eingehende Anrufe" + msgid "Italy" msgstr "Italien" -#: ../plugin.py:581 msgid "Last 10 calls:\n" msgstr "Die letzten zehn Anrufe im Standby:\n" -#: ../plugin.py:503 msgid "MSN to show (separated by ,)" msgstr "anzuzeigende MSNs (getrennt durch ,)" -# This is the text for the yellow button, thus very short... -#: ../plugin.py:469 -msgid "Missed Calls" +#. TRANSLATORS: keep it short, this is a button +msgid "Missed" msgstr "Verpasst" -#: ../plugin.py:331 ../plugin.py:366 ../plugin.py:940 msgid "Missed calls" msgstr "Verpasste Anrufe" -#: ../plugin.py:352 -msgid "Missed calls during Standby" -msgstr "Verpasste Anrufe während Standby" - -#: ../plugin.py:468 +#. TRANSLATORS: keep it short, this is a button msgid "OK" msgstr "OK" -#: ../plugin.py:624 +#. TRANSLATORS: keep it short, this is a button +msgid "Outgoing" +msgstr "Abgehend" + #, python-format msgid "" "Outgoing Call on %(date)s to\n" @@ -207,82 +187,69 @@ msgstr "" "---------------------------------------------\n" "von: %(phone)s" -#: ../plugin.py:513 +msgid "Outgoing calls" +msgstr "Abgehende Anrufe" + msgid "Password Accessing FRITZ!Box" msgstr "Passwort der FRITZ!Box" -#: ../plugin.py:522 +#. TRANSLATORS: keep it short, this is a button +msgid "Phone calls" +msgstr "Telefonanrufe" + msgid "PhoneBook Location" msgstr "Speicherort des Telefonbuchs" -#: ../plugin.py:514 msgid "Read PhoneBook from FRITZ!Box" msgstr "Telefonbuch der FRITZ!Box auslesen" -#: ../plugin.py:509 msgid "Reverse Lookup Caller ID (select country below)" msgstr "Rückwärtssuche (bitte Land auswählen)" -#: ../plugin.py:200 ../plugin.py:224 msgid "Shortcut" msgstr "Kurzwahl" -#: ../plugin.py:501 msgid "Show Calls for specific MSN" msgstr "Zeige nur Anrufe bestimmter Nummern" -#: ../plugin.py:505 msgid "Show Outgoing Calls" -msgstr "Zeige ausgehende Anrufe an" +msgstr "Zeige abgehende Anrufe an" -#: ../plugin.py:499 msgid "Show after Standby" msgstr "Anzeige nach Standby" -#: ../plugin.py:525 msgid "Strip Leading 0" msgstr "Führende 0 entfernen" -#: ../plugin.py:61 msgid "Switzerland" msgstr "Schweiz" -#: ../plugin.py:58 msgid "The Netherlands" msgstr "Niederlande" -#: ../plugin.py:508 msgid "Timeout for Call Notifications (seconds)" msgstr "Anzeigedauer in Sekunden" -#: ../plugin.py:252 ../plugin.py:596 ../plugin.py:670 ../plugin.py:683 -#: ../plugin.py:694 ../plugin.py:708 ../plugin.py:727 ../plugin.py:781 -#: ../plugin.py:864 msgid "UNKNOWN" msgstr "UNBEKANNT" -#: ../plugin.py:50 msgid "USB Stick" msgstr "USB Stick" -#: ../plugin.py:520 msgid "Use internal PhoneBook" msgstr "Benutze internes Telefonbuch" -#: ../plugin.py:202 ../plugin.py:226 msgid "Vanity" msgstr "Vanity" -#: ../plugin.py:463 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:259 msgid "" "You need to set the password of the FRITZ!Box\n" -"in the configuration dialog to display missed calls\n" +"in the configuration dialog to display calls\n" "\n" "It could be a communication issue, just try again." msgstr "" @@ -292,26 +259,41 @@ msgstr "" "Es könnte eine Kommunikationsproblem mit der FRITZ!Box sein.\n" "Versuchen Sie es nochmal." -#: ../plugin.py:195 +msgid "done" +msgstr "fertig" + +msgid "done, using last list" +msgstr "fertig, benutze letzte Liste" + +msgid "finishing" +msgstr "Fertigstellung" + msgid "home" msgstr "privat" -#: ../plugin.py:193 +msgid "login" +msgstr "Login" + +msgid "login ok" +msgstr "Login OK" + +msgid "login verification" +msgstr "Login Verifikation" + msgid "mobile" msgstr "mobil" -#: ../plugin.py:40 +msgid "preparing" +msgstr "Vorbereitung" + msgid "show as list" msgstr "Liste der Anrufe" -#: ../plugin.py:40 msgid "show each call" msgstr "Anzeige der einzelnen Anrufe" -#: ../plugin.py:40 msgid "show nothing" msgstr "keine Anzeige" -#: ../plugin.py:197 msgid "work" msgstr "geschäftlich" diff --git a/fritzcall/po/it.po b/fritzcall/po/it.po index 5cf14964..d524d1ab 100644 --- a/fritzcall/po/it.po +++ b/fritzcall/po/it.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: Enigma2 FRITZ!Box plugin italian locale\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-08-24 09:51+0200\n" -"PO-Revision-Date: 2008-08-23 22:21+0100\n" +"POT-Creation-Date: 2008-09-07 19:04+0200\n" +"PO-Revision-Date: 2008-09-08 15:51+0100\n" "Last-Translator: Spaeleus \n" "Language-Team: www.linsat.net \n" "MIME-Version: 1.0\n" @@ -14,6 +14,13 @@ msgstr "" "X-Poedit-Country: ITALY\n" "X-Poedit-SourceCharset: iso-8859-1\n" +#. TRANSLATORS: keep it short, this is a button +msgid "All" +msgstr "Tutte" + +msgid "All calls" +msgstr "Tutte le Chiamate" + msgid "Append shortcut number" msgstr "Aggiungere numero breve" @@ -41,6 +48,7 @@ msgstr "Monitoraggio chiamate" msgid "Can't create PhoneBook.txt" msgstr "Impossibile creare PhoneBook.txt!" +#. TRANSLATORS: keep it short, this is a button msgid "Cancel" msgstr "Annullare" @@ -71,8 +79,8 @@ msgstr "" "Nuovo tentativo in corso..." #, python-format -msgid "Could not load missed calls from FRITZ!Box - Error: %s" -msgstr "Impossibile caricare la rubrica dalla FRITZ!Box! - Errore: %s" +msgid "Could not load calls from FRITZ!Box - Error: %s" +msgstr "Impossibile caricare le chiamate dalla FRITZ!Box! - Errore: %s" #, python-format msgid "Could not load phonebook from FRITZ!Box - Error: %s" @@ -109,12 +117,16 @@ msgstr "Configurazione FritzCall" msgid "Germany" msgstr "Germania" -msgid "Getting missed calls from FRITZ!Box..." -msgstr "Recupero chiamate perse dalla FRITZ!Box in corso" +msgid "Getting calls from FRITZ!Box..." +msgstr "Recupero chiamate dalla FRITZ!Box in corso" msgid "Harddisk" msgstr "Harddisk" +#. TRANSLATORS: keep it short, this is a button +msgid "Incoming" +msgstr "In Entr." + #, python-format msgid "" "Incoming Call on %(date)s from\n" @@ -131,6 +143,9 @@ msgstr "" "---------------------------------------------\n" "a: %(phone)s" +msgid "Incoming calls" +msgstr "Chiamate in Ingresso" + msgid "Italy" msgstr "Italia" @@ -140,18 +155,21 @@ msgstr "Ultime 10 chiamate:\n" msgid "MSN to show (separated by ,)" msgstr "MSN da mostrare (separare con ,)" -msgid "Missed Calls" +#. TRANSLATORS: keep it short, this is a button +msgid "Missed" msgstr "Ch. Perse" msgid "Missed calls" msgstr "Chiamate perse" -msgid "Missed calls during Standby" -msgstr "Chiamate perse durante lo standby" - +#. TRANSLATORS: keep it short, this is a button msgid "OK" msgstr "OK" +#. TRANSLATORS: keep it short, this is a button +msgid "Outgoing" +msgstr "In Uscita" + #, python-format msgid "" "Outgoing Call on %(date)s to\n" @@ -168,9 +186,16 @@ msgstr "" "---------------------------------------------\n" "da: %(phone)s" +msgid "Outgoing calls" +msgstr "Chiamate in Uscita" + msgid "Password Accessing FRITZ!Box" msgstr "Password di accesso alla FRITZ!Box" +#. TRANSLATORS: keep it short, this is a button +msgid "Phone calls" +msgstr "Ch. Telef." + msgid "PhoneBook Location" msgstr "Posizione Rubrica" @@ -221,21 +246,42 @@ msgstr "Per abilitare il monitoraggio sulla FRITZ!Box comporre #96*5*!" msgid "" "You need to set the password of the FRITZ!Box\n" -"in the configuration dialog to display missed calls\n" +"in the configuration dialog to display calls\n" "\n" "It could be a communication issue, just try again." msgstr "" "E' necessario impostare la password della FRITZ!Box\n" -"nel menu configurazione per mostrare le chiamate perse.\n" +"nel menu configurazione per mostrare le chiamate.\n" "\n" "Potrebbe trattarsi di un problema di comunicazione, riprovare." +msgid "done" +msgstr "Fatto" + +msgid "done, using last list" +msgstr "Fatto, sarà usata l'ultima lista" + +msgid "finishing" +msgstr "Quasi terminato..." + msgid "home" msgstr "Casa" +msgid "login" +msgstr "Login" + +msgid "login ok" +msgstr "Login OK" + +msgid "login verification" +msgstr "Verifica Login" + msgid "mobile" msgstr "Cellulare" +msgid "preparing" +msgstr "Preparazione in corso" + msgid "show as list" msgstr "Come lista" @@ -248,5 +294,3 @@ msgstr "Nulla" msgid "work" msgstr "Ufficio" -#~ msgid "Prefix for Outgoing Calls" -#~ msgstr "Prefisso per le chiamate in uscita" diff --git a/fritzcall/src/plugin.py b/fritzcall/src/plugin.py index 33aec7ed..f9aa5b03 100644 --- a/fritzcall/src/plugin.py +++ b/fritzcall/src/plugin.py @@ -22,7 +22,7 @@ from xml.dom.minidom import parse from os import path as os_path from urllib import urlencode -import re +import re, time import gettext from Tools.Directories import resolveFilename, SCOPE_PLUGINS @@ -57,15 +57,26 @@ config.plugins.FritzCall.prefix = ConfigText(default = "", fixed_size = False) config.plugins.FritzCall.prefix.setUseableChars('0123456789') countryCodes = [ - ("0049", _("Germany")), - ("0031", _("The Netherlands")), - ("0033", _("France")), - ("0039", _("Italy")), - ("0041", _("Switzerland")), - ("0043", _("Austria")) - ] + ("0049", _("Germany")), + ("0031", _("The Netherlands")), + ("0033", _("France")), + ("0039", _("Italy")), + ("0041", _("Switzerland")), + ("0043", _("Austria")) + ] config.plugins.FritzCall.country = ConfigSelection(choices = countryCodes) +FBF_ALL_CALLS = "." +FBF_IN_CALLS = "1" +FBF_MISSED_CALLS = "2" +FBF_OUT_CALLS = "3" +fbfCallsChoices = {FBF_ALL_CALLS: _("All calls"), + FBF_IN_CALLS: _("Incoming calls"), + FBF_MISSED_CALLS: _("Missed calls"), + FBF_OUT_CALLS: _("Outgoing calls") + } +config.plugins.FritzCall.fbfCalls = ConfigSelection(choices = fbfCallsChoices) + def html2utf8(in_html): try: import htmlentitydefs @@ -92,13 +103,24 @@ def html2utf8(in_html): return in_html.replace("&", "&").replace("ß", "ß").replace("ä", "ä").replace("ö", "ö").replace("ü", "ü").replace("Ä", "Ä").replace("Ö", "Ö").replace("Ü", "Ü") return in_html + class FritzCallFBF: def __init__(self): print "[FritzCallFBF] __init__" - self.missedCallback = None + self.callScreen= None + self.loggedIn = False + self.Callback = None self.loginCallback = None + self.timestamp = 0 + self.callList = [] + self.callType = config.plugins.FritzCall.fbfCalls.value def notify(self, text): + print "[FritzCallFBF] notify" + if self.callScreen: + print "[FritzCallFBF] notify: try to close callScreen" + self.callScreen.close() + self.callScreen = None Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_ERROR, timeout=config.plugins.FritzCall.timeout.value) def errorLogin(self, error): @@ -108,6 +130,8 @@ class FritzCallFBF: def _gotPageLogin(self, html): # print "[FritzCallPhonebook] _gotPageLogin" # workaround: exceptions in gotPage-callback were ignored + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("login verification")) try: print "[FritzCallFBF] _gotPageLogin: verify login" found = re.match('.*

FEHLER: Das angegebene Kennwort', html, re.S) @@ -115,6 +139,9 @@ class FritzCallFBF: text = _("FRITZ!Box Login failed! - Wrong Password!") self.notify(text) else: + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("login ok")) + self.loggedIn = True self.loginCallback() loginCallback = None except: @@ -125,6 +152,8 @@ class FritzCallFBF: def login(self): print "[FritzCallFBF] Login" if config.plugins.FritzCall.password.value != "": + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("login")) host = "%d.%d.%d.%d" %tuple(config.plugins.FritzCall.hostname.value) uri = "/cgi-bin/webcm" parms = "login:command/password=%s" %(config.plugins.FritzCall.password.value) @@ -237,10 +266,10 @@ class FritzCallFBF: self.notify(_("Could not parse FRITZ!Box Phonebook entry")) def errorCalls(self, error): - text = _("Could not load missed calls from FRITZ!Box - Error: %s") %error + text = _("Could not load calls from FRITZ!Box - Error: %s") %error self.notify(text) - def _gotPageCalls(self, html): + def _gotPageCalls(self, csv = ""): def _resolveNumber(number): if number.isdigit(): if config.plugins.FritzCall.internal.value and len(number) > 3 and number[0]=="0": number = number[1:] @@ -255,73 +284,112 @@ class FritzCallFBF: # if len(number) > 20: number = number[:20] return number - # check for error: wrong password or password not set... TODO - found = re.search('Melden Sie sich mit dem Kennwort der FRITZ!Box an', html) - if found: - text = _("You need to set the password of the FRITZ!Box\nin the configuration dialog to display missed calls\n\nIt could be a communication issue, just try again.") - # self.session.open(MessageBox, text, MessageBox.TYPE_ERROR, timeout=config.plugins.FritzCall.timeout.value) - self.notify(text) - return + if csv: + print "[FritzCallFBF] _gotPageCalls: got csv, setting callList" + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("done")) + # check for error: wrong password or password not set... TODO + found = re.search('Melden Sie sich mit dem Kennwort der FRITZ!Box an', csv) + if found: + text = _("You need to set the password of the FRITZ!Box\nin the configuration dialog to display calls\n\nIt could be a communication issue, just try again.") + # self.session.open(MessageBox, text, MessageBox.TYPE_ERROR, timeout=config.plugins.FritzCall.timeout.value) + self.notify(text) + return - # print "[FritzCallFBF] _gotPageCalls:\n" + html - html = html.decode('iso-8859-1','replace').encode('utf-8','replace') - lines = html.splitlines() + csv = csv.decode('iso-8859-1','replace').encode('utf-8','replace') + lines = csv.splitlines() + self.callList = lines + elif self.callList: + print "[FritzCallFBF] _gotPageCalls: got no csv, but have callList" + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("done, using last list")) + lines = self.callList + else: + print "[FritzCallFBF] _gotPageCalls: got no csv, no callList, leaving" + return + text = "" + noCalls = 0 for line in lines: # print line # Typ;Datum;Name;Rufnummer;Nebenstelle;Eigene Rufnummer;Dauer - found = re.match("^2;([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)", line) + found = re.match("^(" + self.callType + ");([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)", line) if found: - date = found.group(1) - if found.group(2): - caller = found.group(2) + direct = found.group(1) + date = found.group(2) + if direct != FBF_OUT_CALLS and found.group(3): + caller = found.group(3) + else: + caller = _resolveNumber(found.group(4)) + found1 = re.match('Internet: (.*)', found.group(6)) + if found1: + callee = _resolveNumber(found1.group(1)) else: - caller = _resolveNumber(found.group(3)) - callee = _resolveNumber(found.group(5)) + callee = _resolveNumber(found.group(6)) while (len(caller) + len(callee)) > 40: if len(caller) > len(callee): caller = caller[:-1] else: callee = callee[:-1] found = re.match("(\d\d.\d\d.)\d\d( \d\d:\d\d)", date) - if found: date = found.group(1) + found.group(2) - text = text + "\n" + date + " " + caller + " -> " + callee + if found: date = found.group(1) + found.group(2) + if direct == FBF_OUT_CALLS: + text = text + date + "\t" + callee + " -> " + caller + "\n" + else: + text = text + date + "\t" + caller + " -> " + callee + "\n" + noCalls += 1 # print "[FritzCallFBF] _gotPageCalls result:\n" + text - if self.missedCallback is not None: + if self.Callback is not None: # print "[FritzCallFBF] _gotPageCalls call callback with\n" + text - self.missedCallback(text = text) - self.missedCallback = None + self.Callback(text = text, count = noCalls) + self.Callback = None + self.callScreen = None - def getMissedCalls(self, callback): + def getCalls(self, callScreen, callback, type): # # call sequence must be: # - login # - getPage -> _gotPageLogin - # - loginCallback (_getMissedCalls) - # - getPage -> _getMissedCalls1 - print "[FritzCallFBF] getMissedCalls" - self.missedCallback = callback - self.loginCallback = self._getMissedCalls - self.login() - - def _getMissedCalls(self): + # - loginCallback (_getCalls) + # - getPage -> _getCalls1 + print "[FritzCallFBF] getCalls" + self.callScreen = callScreen + self.callType = type + self.Callback = callback + if (time.time() - self.timestamp) > 180: + print "[FritzCallFBF] getCalls: outdated data, login and get new ones" + self.timestamp = time.time() + self.loginCallback = self._getCalls + self.login() + elif not self.callList: + print "[FritzCallFBF] getCalls: time is ok, but no callList" + self._getCalls1() + else: + print "[FritzCallFBF] getCalls: time is ok, callList is ok" + self._gotPageCalls() + + def _getCalls(self): # # we need this to fill Anrufliste.csv # http://repeater1/cgi-bin/webcm?getpage=../html/de/menus/menu2.html&var:lang=de&var:menu=fon&var:pagename=foncalls # - print "[FritzCallFBF] _getMissedCalls" + print "[FritzCallFBF] _getCalls" + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("preparing")) host = "%d.%d.%d.%d" %tuple(config.plugins.FritzCall.hostname.value) parms = urlencode({'getpage':'../html/de/menus/menu2.html', 'var:lang':'de','var:pagename':'foncalls','var:menu':'fon'}) url = "http://%s/cgi-bin/webcm?%s" %(host, parms) - getPage(url).addCallback(self._getMissedCalls1).addErrback(self.errorCalls) + getPage(url).addCallback(self._getCalls1).addErrback(self.errorCalls) - def _getMissedCalls1(self, html): + def _getCalls1(self, html = ""): # # finally we should have successfully lgged in and filled the csv # - print "[FritzCallFBF] _getMissedCalls1" + print "[FritzCallFBF] _getCalls1" + if self.callScreen: + self.callScreen.updateStatus(_("Getting calls from FRITZ!Box...") + _("finishing")) host = "%d.%d.%d.%d" %tuple(config.plugins.FritzCall.hostname.value) parms = urlencode({'getpage':'../html/de/FRITZ!Box_Anrufliste.csv'}) url = "http://%s/cgi-bin/webcm?%s" %(host, parms) @@ -329,20 +397,41 @@ class FritzCallFBF: fritzbox = FritzCallFBF() -class FritzDisplayMissedCalls(Screen): +class FritzDisplayCalls(Screen): skin = """ - - - - """ % _("Missed calls") + + + + + + + + + + + + """ % _("Phone calls") def __init__(self, session, text = ""): - self.skin = FritzDisplayMissedCalls.skin + self.skin = FritzDisplayCalls.skin Screen.__init__(self, session) - self["setupActions"] = ActionMap(["OkCancelActions", "DirectionActions"], + # TRANSLATORS: keep it short, this is a button + self["key_red"] = Button(_("All")) + # TRANSLATORS: keep it short, this is a button + self["key_green"] = Button(_("Missed")) + # TRANSLATORS: keep it short, this is a button + self["key_yellow"] = Button(_("Incoming")) + # TRANSLATORS: keep it short, this is a button + self["key_blue"] = Button(_("Outgoing")) + + self["setupActions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions"], { + "red": self.displayAllCalls, + "green": self.displayMissedCalls, + "yellow": self.displayInCalls, + "blue": self.displayOutCalls, "down": self.pageDown, "up": self.pageUp, "right": self.pageDown, @@ -351,13 +440,10 @@ class FritzDisplayMissedCalls(Screen): "save": self.ok, "ok": self.ok,}, -2) - if text == "": - self["statusbar"] = Label(_("Getting missed calls from FRITZ!Box...")) - self["list"] = ScrollLabel("") - fritzbox.getMissedCalls(self.gotMissedCalls) - else: - self["statusbar"] = Label(_("Missed calls during Standby")) - self["list"] = ScrollLabel(text) + self["statusbar"] = Label(_("Getting calls from FRITZ!Box...")) + self["list"] = ScrollLabel("") + print "[FritzDisplayCalls] init: '''%s'''" %config.plugins.FritzCall.fbfCalls.value + self.displayCalls() def ok(self): self.close() @@ -368,20 +454,49 @@ class FritzDisplayMissedCalls(Screen): def pageUp(self): self["list"].pageUp() - def gotMissedCalls(self, text): - # print "[FritzDisplayMissedCalls] gotMissedCalls:\n" + text - self["statusbar"].setText(_("Missed calls")) + def displayAllCalls(self): + print "[FritzDisplayCalls] displayAllCalls" + config.plugins.FritzCall.fbfCalls.value = FBF_ALL_CALLS + config.plugins.FritzCall.fbfCalls.save() + self.displayCalls() + + def displayMissedCalls(self): + print "[FritzDisplayCalls] displayMissedCalls" + config.plugins.FritzCall.fbfCalls.value = FBF_MISSED_CALLS + config.plugins.FritzCall.fbfCalls.save() + self.displayCalls() + + def displayInCalls(self): + print "[FritzDisplayCalls] displayInCalls" + config.plugins.FritzCall.fbfCalls.value = FBF_IN_CALLS + config.plugins.FritzCall.fbfCalls.save() + self.displayCalls() + + def displayOutCalls(self): + print "[FritzDisplayCalls] displayOutCalls" + config.plugins.FritzCall.fbfCalls.value = FBF_OUT_CALLS + config.plugins.FritzCall.fbfCalls.save() + self.displayCalls() + + def displayCalls(self): + print "[FritzDisplayCalls] displayCalls" + self.header = fbfCallsChoices[config.plugins.FritzCall.fbfCalls.value] + fritzbox.getCalls(self, self.gotCalls, config.plugins.FritzCall.fbfCalls.value) + + def gotCalls(self, text, count): + # print "[FritzDisplayCalls] gotCalls:\n" + text + self["statusbar"].setText(self.header + " (" + str(count) + ")") self["list"].setText(text) + def updateStatus(self, text): + self["statusbar"].setText(text) + class FritzCallPhonebook: def __init__(self): self.phonebook = {} self.reload() - def notify(self, text): - Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_ERROR, timeout=config.plugins.FritzCall.timeout.value) - def create(self): try: f = open(config.plugins.FritzCall.phonebookLocation.value, 'w') @@ -420,7 +535,7 @@ class FritzCallPhonebook: fritzbox.loadFritzBoxPhonebook() def search(self, number): - print "[FritzCallPhonebook] Searching for %s" %number + # print "[FritzCallPhonebook] Searching for %s" %number name = None if config.plugins.FritzCall.phonebook.value or config.plugins.FritzCall.fritzphonebook.value: if self.phonebook.has_key(number): @@ -471,21 +586,24 @@ class FritzCallSetup(ConfigListScreen, Screen): self.list = [] # Initialize Buttons + # TRANSLATORS: keep it short, this is a button self["key_red"] = Button(_("Cancel")) + # TRANSLATORS: keep it short, this is a button self["key_green"] = Button(_("OK")) - self["key_yellow"] = Button(_("Missed Calls")) + # TRANSLATORS: keep it short, this is a button + self["key_yellow"] = Button(_("Phone calls")) self["setupActions"] = ActionMap(["SetupActions", "ColorActions"], { "cancel": self.cancel, - "red": self.cancel, # not strictly needed, better for clarity + "red": self.cancel, # not strictly needed, better for clarity "save": self.save, - "green": self.save, # not strictly needed, better for clarity - "yellow": self.displayMissedCalls, + "green": self.save, # not strictly needed, better for clarity + "yellow": self.displayCalls, "ok": self.save, }, -2) - ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed) + ConfigListScreen.__init__(self, self.list, session = session) self.createSetup() @@ -531,6 +649,7 @@ class FritzCallSetup(ConfigListScreen, Screen): self.list.append(getConfigListEntry(_("Automatically add new Caller to PhoneBook"), config.plugins.FritzCall.addcallers)) self.list.append(getConfigListEntry(_("Strip Leading 0"), config.plugins.FritzCall.internal)) + # self.list.append(getConfigListEntry(_("Default display mode for FRITZ!Box calls"), config.plugins.FritzCall.fbfCalls)) self["config"].list = self.list self["config"].l.setList(self.list) @@ -558,8 +677,8 @@ class FritzCallSetup(ConfigListScreen, Screen): x[1].cancel() self.close() - def displayMissedCalls(self): - self.session.open(FritzDisplayMissedCalls) + def displayCalls(self): + self.session.open(FritzDisplayCalls) standbyMode = False @@ -618,7 +737,7 @@ class FritzCallList: print "[FritzCallList] display: '%s %s %s %s'" %(date, caller, direction, phone) # display screen Notifications.AddNotification(MessageBox, text, type=MessageBox.TYPE_INFO) - # my_global_session.open(FritzDisplayMissedCalls, text) # TODO please HELP: from where can I get a session? + # my_global_session.open(FritzDisplayCalls, text) # TODO please HELP: from where can I get a session? self.callList = [ ] self.text = "" @@ -663,7 +782,6 @@ class FritzReverseLookupAndNotifier: self.date = date self.currentWebsite = None self.nextWebsiteNo = 0 - self.countrycode = "0049" if not countries: dom = parse(resolveFilename(SCOPE_PLUGINS, "Extensions/FritzCall/reverselookup.xml")) @@ -680,7 +798,7 @@ class FritzReverseLookupAndNotifier: return if self.number[:2] == "00": - if countries.has_key(self.number[:3]): # e.g. USA + if countries.has_key(self.number[:3]): # e.g. USA self.countrycode = self.number[:3] elif countries.has_key(self.number[:4]): self.countrycode = self.number[:4] @@ -857,7 +975,7 @@ class FritzProtocol(LineReceiver): else: self.number = number - if self.event == "CALL" and self.number[0] != '0': # should only happen for outgoing + if self.event == "CALL" and self.number[0] != '0': # should only happen for outgoing self.number = config.plugins.FritzCall.prefix.value + self.number if self.number is not "": @@ -919,8 +1037,8 @@ class FritzCall: self.d[1].disconnect() self.d = None -def displayMissedCalls(session, servicelist): - session.open(FritzDisplayMissedCalls) +def displayCalls(session, servicelist): + session.open(FritzDisplayCalls) def main(session): session.open(FritzCallSetup) @@ -945,7 +1063,7 @@ def autostart(reason, **kwargs): def Plugins(**kwargs): what = _("Display FRITZ!box-Fon calls on screen") - what_missed = _("Missed calls") + what_calls = _("Phone calls") return [ PluginDescriptor(name="FritzCall", description=what, where = PluginDescriptor.WHERE_PLUGINMENU, icon = "plugin.png", fnc=main), - PluginDescriptor(name=what_missed, description=what_missed, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=displayMissedCalls), + PluginDescriptor(name=what_calls, description=what_calls, where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=displayCalls), PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart) ] diff --git a/fritzcall/src/reverselookup.xml b/fritzcall/src/reverselookup.xml index a12df764..1f909163 100644 --- a/fritzcall/src/reverselookup.xml +++ b/fritzcall/src/reverselookup.xml @@ -755,7 +755,8 @@ <font [^>]*>[0-9]*&nbsp;[^&]*[^-]*-([^<]*)< <font [^>]*>[0-9]*&nbsp;([^&]*)[^-]*-[^<]*< <font [^>]*>([0-9]*)&nbsp;[^&]*[^-]*-[^<]*< - + + <td class="dati"><span [^>]*>([^<]*)</span><br>[0-9]*&nbsp;[^&]*[^-]*-[^<]*< <td class="dati"><span [^>]*>[^<]*</span><br>[0-9]*&nbsp;[^&]*[^-]*-([^<]*)< <td class="dati"><span [^>]*>[^<]*</span><br>[0-9]*&nbsp;([^&]*)[^-]*-[^<]*< @@ -774,7 +775,7 @@ - <div class="rname"><h4><a[^>]*>([^<]*)</a> + <div class="rname"><h[1-9]*><a[^>]*>([^<]*)</a> <div class="raddr">([^<,]*),\s*[0-9]*[^<]*</div> <div class="raddr">[^<,]*,\s*[0-9]*([^<]*)</div> <div class="raddr">[^<,]*,\s*([0-9]*)[^<]*</div> @@ -866,6 +867,22 @@ class="location">[^<]+<br />(\d{5})\s+[^<]+</span> + + + <a href="[^"]*" onClick="[^"]*" title="[^"]*">([^<]*)</a> + <p class="address">([^<]*)<br />[\d]* [^<]*</p> + <p class="address">[^<]*<br />[\d]* ([^<]*)</p> + <p class="address">[^<]*<br />([\d]*) [^<]*</p> + + + + + <a style="text-decoration: underline;" href="[^"]*" onclick="[^"]*" class="popup"[^>]*>([^<]*)</a> + <div style="padding-bottom:5px;">\s*([^,]*), [\d]* [^<]*<br /> + <div style="padding-bottom:5px;">\s*[^,]*, [\d]* ([^<]*)<br /> + <div style="padding-bottom:5px;">\s*[^,]*, ([\d]*) [^<]*<br /> + +