ORFteletext first check into CVS
authorVali Jordan <vali@users.schwerkraft.elitedvb.net>
Tue, 9 Nov 2010 14:55:16 +0000 (14:55 +0000)
committerVali Jordan <vali@users.schwerkraft.elitedvb.net>
Tue, 9 Nov 2010 14:55:16 +0000 (14:55 +0000)
orfteletext/CONTROL/control [new file with mode: 0644]
orfteletext/Makefile.am [new file with mode: 0755]
orfteletext/meta/Makefile.am [new file with mode: 0755]
orfteletext/meta/orfteletext.jpg [new file with mode: 0644]
orfteletext/meta/plugin_orfteletext.xml [new file with mode: 0755]
orfteletext/src/Makefile.am [new file with mode: 0755]
orfteletext/src/__init__.py [new file with mode: 0644]
orfteletext/src/maintainer.info [new file with mode: 0644]
orfteletext/src/nodata.png [new file with mode: 0644]
orfteletext/src/plugin.py [new file with mode: 0644]

diff --git a/orfteletext/CONTROL/control b/orfteletext/CONTROL/control
new file mode 100644 (file)
index 0000000..03521b5
--- /dev/null
@@ -0,0 +1,10 @@
+Package: enigma2-plugin-extensions-orfteletext
+Version: 1.0
+Description: ORFteletext
+Architecture: mipsel
+Section: extra
+Priority: optional
+Maintainer: Vali
+Homepage: http://www.dreambox-tools.info
+Depends: enigma2(>2.6git20091201)
+Source: http://enigma2-plugins.schwerkraft.elitedvb.net/
diff --git a/orfteletext/Makefile.am b/orfteletext/Makefile.am
new file mode 100755 (executable)
index 0000000..ff1ac3d
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = src meta
diff --git a/orfteletext/meta/Makefile.am b/orfteletext/meta/Makefile.am
new file mode 100755 (executable)
index 0000000..1df506d
--- /dev/null
@@ -0,0 +1,5 @@
+installdir = $(datadir)/meta/
+
+dist_install_DATA = plugin_orfteletext.xml
+
+EXTRA_DIST = orfteletext.jpg
diff --git a/orfteletext/meta/orfteletext.jpg b/orfteletext/meta/orfteletext.jpg
new file mode 100644 (file)
index 0000000..aaa63a9
Binary files /dev/null and b/orfteletext/meta/orfteletext.jpg differ
diff --git a/orfteletext/meta/plugin_orfteletext.xml b/orfteletext/meta/plugin_orfteletext.xml
new file mode 100755 (executable)
index 0000000..9378a5c
--- /dev/null
@@ -0,0 +1,17 @@
+<default>
+         <prerequisites>
+                    <tag type="Multimedia" />
+         </prerequisites>
+          <info>
+                    <author>Vali</author>
+                    <name>ORFteletext</name>
+                    <packagename>enigma2-plugin-extensions-orfteletext</packagename>
+                    <shortdescription>Browse ORF Teletext independent from channel. This need I-net conection.</shortdescription>
+                    <description>Browse ORF Teletext independent from channel. This need I-net conection.</description>
+                    <screenshot src="http://www.dreamboxupdate.com/preview/plugin_orfteletext.jpg" />              
+          </info>
+
+         <files type="package"> <!-- without version, without .ipk -->
+               <file type="package" name="enigma2-plugin-extensions-orfteletext" />
+         </files>
+</default>
diff --git a/orfteletext/src/Makefile.am b/orfteletext/src/Makefile.am
new file mode 100755 (executable)
index 0000000..8a480ec
--- /dev/null
@@ -0,0 +1,5 @@
+installdir = /usr/lib/enigma2/python/Plugins/Extensions/ORFteletext
+
+install_PYTHON = *.py
+
+install_DATA = maintainer.info *.png
diff --git a/orfteletext/src/__init__.py b/orfteletext/src/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/orfteletext/src/maintainer.info b/orfteletext/src/maintainer.info
new file mode 100644 (file)
index 0000000..7ea2926
--- /dev/null
@@ -0,0 +1,2 @@
+vali@dreambox-tools.info
+ORFteletext
diff --git a/orfteletext/src/nodata.png b/orfteletext/src/nodata.png
new file mode 100644 (file)
index 0000000..ef4665d
Binary files /dev/null and b/orfteletext/src/nodata.png differ
diff --git a/orfteletext/src/plugin.py b/orfteletext/src/plugin.py
new file mode 100644 (file)
index 0000000..2575e9a
--- /dev/null
@@ -0,0 +1,233 @@
+#######################################################################
+#
+#    ORFteletext for Dreambox-Enigma2
+#    Coded by Vali (c)2010
+#    Support: www.dreambox-tools.info
+#
+#  This plugin is licensed under the Creative Commons 
+#  Attribution-NonCommercial-ShareAlike 3.0 Unported License.
+#  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
+#  or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+#
+#  Alternatively, this plugin may be distributed and executed on hardware which
+#  is licensed by Dream Multimedia GmbH.
+#
+#
+#  This plugin is NOT free software. It is open source, you are allowed to
+#  modify it (if you keep the license), but it may not be commercially 
+#  distributed other than under the conditions noted above.
+#
+#
+#######################################################################
+
+
+
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Plugins.Plugin import PluginDescriptor
+from Components.ActionMap import NumberActionMap
+from Components.AVSwitch import AVSwitch
+from Components.Pixmap import Pixmap
+from Components.MenuList import MenuList
+from Components.Label import Label
+from Tools.Directories import fileExists
+from enigma import ePicLoad, getDesktop
+from os import system as os_system
+
+
+
+def Plugins(**kwargs):
+       return [PluginDescriptor(name="ORF-Teletext", description=_("ORF-Teletext"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main),]
+
+
+
+def main(session, **kwargs):
+       session.open(ORFteletextScreen)
+
+
+
+class ORFteletextScreen(Screen):
+       if (getDesktop(0).size().width()) == 1280:
+               skin="""
+                       <screen flags="wfNoBorder" position="0,0" size="1280,720" title="ORF-Teletext" backgroundColor="#00121214">
+                               <widget backgroundColor="#ffffffff" position="30,163" render="Pig" size="700,394" source="session.VideoPicture" zPosition="1"/>
+                               <widget name="Picture" position="740,192" size="480,336" zPosition="1"/>
+                               <widget name="seite" position="770,93" size="200,24" font="Regular;22" transparent="1"/>
+                               <widget name="wohin" position="770,123" size="200,24" font="Regular;22" foregroundColor="#ff4a3c" transparent="1"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ff4A3C" position="320,620" size="120,26" transparent="1" text="NEWS"/>
+                               <eLabel font="Regular;20" foregroundColor="#0056C856" position="320,650" size="120,26" transparent="1" text="WEATHER"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ffc000" position="760,620" size="120,26" transparent="1" text="SPORT"/>
+                               <eLabel font="Regular;20" foregroundColor="#00879ce1" position="760,650" size="120,26" transparent="1" text="INDEX"/>
+                       </screen>"""
+       elif (getDesktop(0).size().width()) == 1024:
+               skin="""
+                       <screen flags="wfNoBorder" position="0,0" size="1024,576" title="ORF-Teletext" backgroundColor="#00121214">
+                               <widget backgroundColor="#ffffffff" position="30,156" render="Pig" size="470,264" source="session.VideoPicture" zPosition="1"/>
+                               <widget name="Picture" position="504,120" size="480,336" zPosition="1"/>
+                               <widget name="seite" position="504,50" size="200,24" font="Regular;22" transparent="1"/>
+                               <widget name="wohin" position="504,75" size="200,24" font="Regular;22" foregroundColor="#ff4a3c" transparent="1"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ff4A3C" position="220,480" size="120,26" transparent="1" text="NEWS"/>
+                               <eLabel font="Regular;20" foregroundColor="#0056C856" position="220,510" size="120,26" transparent="1" text="WEATHER"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ffc000" position="504,480" size="120,26" transparent="1" text="SPORT"/>
+                               <eLabel font="Regular;20" foregroundColor="#00879ce1" position="504,510" size="120,26" transparent="1" text="INDEX"/>
+                       </screen>"""
+       else:
+               skin="""
+                       <screen flags="wfNoBorder" position="0,0" size="720,576" title="ORF-Teletext" backgroundColor="#00121214">
+                               <widget name="seite" position="250,50" size="200,24" font="Regular;22" transparent="1"/>
+                               <widget name="wohin" position="250,75" size="200,24" font="Regular;22" foregroundColor="#ff4a3c" transparent="1"/>
+                               <widget backgroundColor="#ffffffff" position="60,156" render="Pig" size="160,120" source="session.VideoPicture" zPosition="1"/>
+                               <widget name="Picture" position="250,120" size="480,336" zPosition="1"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ff4A3C" position="120,480" size="120,26" transparent="1" text="NEWS"/>
+                               <eLabel font="Regular;20" foregroundColor="#0056C856" position="120,510" size="120,26" transparent="1" text="WEATHER"/>
+                               <eLabel font="Regular;20" foregroundColor="#00ffc000" position="504,480" size="120,26" transparent="1" text="SPORT"/>
+                               <eLabel font="Regular;20" foregroundColor="#00879ce1" position="504,510" size="120,26" transparent="1" text="INDEX"/>
+                       </screen>"""
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               self["seite"] = Label("100")
+               self["wohin"] = Label("")
+               self.seite = 100
+               self.strseite = ""
+               self.subseite = 1
+               self.EXscale = (AVSwitch().getFramebufferScale())
+               self.EXpicload = ePicLoad()
+               self["Picture"] = Pixmap()
+               self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions", "NumberActions"],
+               {
+                       "ok": self.showMe,
+                       "cancel": self.raus,
+                       "left": self.seiteMinus,
+                       "right": self.seitePlus,
+                       "up": self.vor,
+                       "down": self.zurueck,
+                       "1": self.keyNumberGlobal,
+                       "2": self.keyNumberGlobal,
+                       "3": self.keyNumberGlobal,
+                       "4": self.keyNumberGlobal,
+                       "5": self.keyNumberGlobal,
+                       "6": self.keyNumberGlobal,
+                       "7": self.keyNumberGlobal,
+                       "8": self.keyNumberGlobal,
+                       "9": self.keyNumberGlobal,
+                       "0": self.keyNumberGlobal,
+                       "red": self.rot,
+                       "green": self.gruen,
+                       "yellow": self.gelb,
+                       "blue": self.blau
+               }, -1)
+               if fileExists("/tmp/bild"):
+                       self.whatPic = "/tmp/bild"
+               else:
+                       self.whatPic = "/usr/lib/enigma2/python/Plugins/Extensions/ORFteletext/nodata.png"
+               self.EXpicload.PictureData.get().append(self.DecodeAction)
+               self.onLayoutFinish.append(self.firstStart)
+
+       def firstStart(self):
+               self.lade2(self.seite,self.subseite)
+
+       def Show_Picture(self):
+               if self.whatPic is not None:
+                       self.EXpicload.setPara([self["Picture"].instance.size().width(), self["Picture"].instance.size().height(), self.EXscale[0], self.EXscale[1], 0, 1, "#121214"])
+                       self.EXpicload.startDecode(self.whatPic)
+
+       def DecodeAction(self, pictureInfo=" "):
+               if self.whatPic is not None:
+                       ptr = self.EXpicload.getData()
+                       self["Picture"].instance.setPixmap(ptr)
+
+       def raus(self):
+               os_system("rm -f /tmp/bild")
+               self.close()
+
+       def lade2(self, hs, ns):
+               os_system("rm -f /tmp/bild")
+               hz = str(hs)
+               lz = hz[0]
+               nz = str(ns)
+               adr = "http://teletext.orf.at/" + lz + "00/" + hz + "_000" + nz + ".png"
+               neu = "wget -O /tmp/bild " + adr
+               self["seite"].setText(hz+"-"+nz)
+               os_system(neu)
+               if fileExists("/tmp/bild"):
+                       self.whatPic = "/tmp/bild"
+               else:
+                       self.whatPic = "/usr/lib/enigma2/python/Plugins/Extensions/ORFteletext/nodata.png"
+               self.Show_Picture()
+
+       def showMe(self):
+               self.lade2(self.seite,self.subseite)
+
+       def seitePlus(self):
+               if self.subseite < 9:
+                       self.subseite = self.subseite + 1
+               else:
+                       self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def seiteMinus(self):
+               if self.subseite > 1:
+                       self.subseite = self.subseite - 1
+               else:
+                       self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def keyNumberGlobal(self,number):
+               if len(self.strseite) < 3:
+                       self.strseite = self.strseite + str(number)
+                       self["wohin"].setText(self.strseite)
+               if len(self.strseite) == 3:
+                       self.seite = int(self.strseite)
+                       self.subseite = 1
+                       self.lade2(self.seite,self.subseite)
+                       self.strseite = ""
+                       self["wohin"].setText(self.strseite)
+               if len(self.strseite) > 3:
+                       self.strseite = ""
+                       self["wohin"].setText(self.strseite)
+
+       def vor(self):
+               if self.seite < 900:
+                       self.seite = self.seite + 1
+               else:
+                       self.seite = 100
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def zurueck(self):
+               if self.seite > 100:
+                       self.seite = self.seite - 1
+               else:
+                       self.seite = 100
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)    
+
+       def rot(self):
+               self.seite = 111
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def gruen(self):
+               self.seite = 600
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def gelb(self):
+               self.seite = 200
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+
+       def blau(self):
+               self.seite = 890
+               self.subseite = 1
+               self.lade2(self.seite,self.subseite)
+       
+
+
+
+
+
+
+
+
+