aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@saftware.de>2009-08-15 18:45:45 +0200
committerAndreas Oberritter <obi@saftware.de>2009-08-18 15:51:03 +0200
commitf8d1bf38d3aaf22c808dd8aa13378e1c50669718 (patch)
treecc5030eea72edc69f7f00594e056005a0bc0f41f /lib/python
parent5b374e685f27bd083343c943ea715e02679ac028 (diff)
downloadenigma2-f8d1bf38d3aaf22c808dd8aa13378e1c50669718.tar.gz
enigma2-f8d1bf38d3aaf22c808dd8aa13378e1c50669718.zip
remove FritzCall (moved to enigma2-plugins CVS some time ago)
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/FritzCall/.cvsignore4
-rw-r--r--lib/python/Plugins/Extensions/FritzCall/Makefile.am6
-rw-r--r--lib/python/Plugins/Extensions/FritzCall/__init__.py0
-rw-r--r--lib/python/Plugins/Extensions/FritzCall/plugin.py157
4 files changed, 0 insertions, 167 deletions
diff --git a/lib/python/Plugins/Extensions/FritzCall/.cvsignore b/lib/python/Plugins/Extensions/FritzCall/.cvsignore
deleted file mode 100644
index 138b9cc2..00000000
--- a/lib/python/Plugins/Extensions/FritzCall/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-Makefile
-Makefile.in
diff --git a/lib/python/Plugins/Extensions/FritzCall/Makefile.am b/lib/python/Plugins/Extensions/FritzCall/Makefile.am
deleted file mode 100644
index 5fb8eca1..00000000
--- a/lib/python/Plugins/Extensions/FritzCall/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-installdir = $(pkglibdir)/python/Plugins/Extensions/FritzCall
-
-install_PYTHON = \
- __init__.py \
- plugin.py
-
diff --git a/lib/python/Plugins/Extensions/FritzCall/__init__.py b/lib/python/Plugins/Extensions/FritzCall/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/lib/python/Plugins/Extensions/FritzCall/__init__.py
+++ /dev/null
diff --git a/lib/python/Plugins/Extensions/FritzCall/plugin.py b/lib/python/Plugins/Extensions/FritzCall/plugin.py
deleted file mode 100644
index be76f79e..00000000
--- a/lib/python/Plugins/Extensions/FritzCall/plugin.py
+++ /dev/null
@@ -1,157 +0,0 @@
-from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
-from Components.ActionMap import ActionMap
-from Plugins.Plugin import PluginDescriptor
-from Tools import Notifications
-
-from twisted.internet import reactor
-from twisted.internet.protocol import ReconnectingClientFactory
-from twisted.protocols.basic import LineReceiver
-
-my_global_session = None
-
-from Components.config import config, ConfigSubsection, ConfigIP, ConfigEnableDisable, getConfigListEntry
-from Components.ConfigList import ConfigListScreen
-
-config.plugins.FritzCall = ConfigSubsection()
-config.plugins.FritzCall.hostname = ConfigIP(default = [192,168,178,254])
-config.plugins.FritzCall.enable = ConfigEnableDisable(default = False)
-
-class FritzCallSetup(ConfigListScreen, Screen):
- skin = """
- <screen position="100,100" size="550,400" title="FritzCall Setup" >
- <widget name="config" position="20,10" size="460,350" scrollbarMode="showOnDemand" />
- </screen>"""
-
-
- def __init__(self, session, args = None):
- Screen.__init__(self, session)
- self.onClose.append(self.abort)
-
- # nun erzeugen wir eine liste von elementen fuer die menu liste.
- self.list = [ ]
- self.list.append(getConfigListEntry(_("Call monitoring"), config.plugins.FritzCall.enable))
- self.list.append(getConfigListEntry(_("Fritz!Box FON IP address"), config.plugins.FritzCall.hostname))
- ConfigListScreen.__init__(self, self.list)
-
- # DO NOT ASK.
- self["setupActions"] = ActionMap(["SetupActions"],
- {
- "save": self.save,
- "cancel": self.cancel,
- "ok": self.save,
- }, -2)
-
- def abort(self):
- print "aborting"
-
- def save(self):
- for x in self["config"].list:
- x[1].save()
- if fritz_call is not None:
- fritz_call.connect()
- self.close()
-
- def cancel(self):
- for x in self["config"].list:
- x[1].cancel()
- self.close()
-
-class FritzProtocol(LineReceiver):
- delimiter = "\r\n"
-
- def lineReceived(self, line):
-
-#15.07.06 00:38:54;CALL;1;4;<provider>;<callee>;
-#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:27;DISCONNECT;0;0;
-
- a = line.split(';')
- (date, event) = a[0:2]
- line = a[2]
-
- if event == "RING":
- phone = a[4]
- number = a[3]
- text = _("incoming call!\n%s calls on %s!") % (number, phone)
- timeout = 10
- elif event == "DISCONNECT":
- Notifications.RemovePopup("FritzCall_%s" % line)
- return
- else:
- return
-
- Notifications.AddPopup(text=text, type=MessageBox.TYPE_INFO, timeout=timeout, id="FritzCall_%s" % line)
-
-class FritzClientFactory(ReconnectingClientFactory):
-
- initialDelay = 20
- maxDelay = 500
-
- def __init__(self):
- self.hangup_ok = False
-
- def startedConnecting(self, connector):
- Notifications.AddPopup(text=_("Connecting to Fritz!Box..."), type=MessageBox.TYPE_INFO, timeout=2, id="FritzCallConnect")
-
- def buildProtocol(self, addr):
- Notifications.AddPopup(text=_("Connected to Fritz!Box!"), type=MessageBox.TYPE_INFO, timeout=2, id="FritzCallConnect")
- self.resetDelay()
- return FritzProtocol()
-
- def clientConnectionLost(self, connector, reason):
- if not self.hangup_ok:
- Notifications.AddPopup(text=_("Disconnected from\nFritz!Box! (%s)\nretrying...") % reason.getErrorMessage(), type=MessageBox.TYPE_INFO, timeout=4, id="FritzCallConnect")
- ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
-
- def clientConnectionFailed(self, connector, reason):
- Notifications.AddPopup(text=_("Connection to Fritz!Box\nfailed! (%s)\nretrying...") % reason.getErrorMessage(), type=MessageBox.TYPE_INFO, timeout=4, id="FritzCallConnect")
- ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
-
-class FritzCall:
- def __init__(self):
- self.dialog = None
- self.d = None
- self.connect()
-
- def connect(self):
- self.abort()
- if config.plugins.FritzCall.enable.value:
- f = FritzClientFactory()
- self.d = (f, reactor.connectTCP("%d.%d.%d.%d" % tuple(config.plugins.FritzCall.hostname.value), 1012, f))
-
- def shutdown(self):
- self.abort()
-
- def abort(self):
- if self.d is not None:
- self.d[0].hangup_ok = True
- self.d[0].stopTrying()
- self.d[1].disconnect()
- self.d = None
-
-def main(session, **kwargs):
- session.open(FritzCallSetup)
-
-fritz_call = None
-
-def autostart(reason, **kwargs):
- global fritz_call
-
- # ouch, this is a hack
- if kwargs.has_key("session"):
- global my_global_session
- my_global_session = kwargs["session"]
- return
-
- print "autostart"
- if reason == 0:
- fritz_call = FritzCall()
- elif reason == 1:
- fritz_call.shutdown()
- 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) ]