small changes
authorJulian Dittrich <jjbig@users.schwerkraft.elitedvb.net>
Fri, 16 Mar 2007 15:05:13 +0000 (15:05 +0000)
committerJulian Dittrich <jjbig@users.schwerkraft.elitedvb.net>
Fri, 16 Mar 2007 15:05:13 +0000 (15:05 +0000)
webinterface/src/WebComponents/Sources/About.py
webinterface/src/plugin.py
webinterface/src/web-data/gfx/remotecontrol_static.jpg [new file with mode: 0644]
webinterface/src/web-data/style.css
webinterface/src/web-data/tools.js
webinterface/src/web/wapwrapper.xml [new file with mode: 0644]
webinterface/src/webif.py

index 705662c..6707e7f 100644 (file)
@@ -78,19 +78,33 @@ class About( Source):
             svfeinfo = None
 
         # Get Service Info
-        list.append(svinfo.getInfoString(iServiceInformation.sProvider))
-        list.append(svinfo.getInfo(iServiceInformation.sAspect))
-        list.append(hex(svinfo.getInfo(iServiceInformation.sNamespace)))
-
-        # Get PIDs
-        list.append(svinfo.getInfo(iServiceInformation.sVideoPID))
-        list.append(svinfo.getInfo(iServiceInformation.sAudioPID))
-        list.append(svinfo.getInfo(iServiceInformation.sPCRPID))
-        list.append(svinfo.getInfo(iServiceInformation.sPMTPID))
-        list.append(svinfo.getInfo(iServiceInformation.sTXTPID))
-        list.append(svinfo.getInfo(iServiceInformation.sTSID))
-        list.append(svinfo.getInfo(iServiceInformation.sONID))
-        list.append(svinfo.getInfo(iServiceInformation.sSID))
+        if svinfo is not None:
+            list.append(svinfo.getInfoString(iServiceInformation.sProvider))
+            list.append(svinfo.getInfo(iServiceInformation.sAspect))
+            list.append(hex(svinfo.getInfo(iServiceInformation.sNamespace)))
+
+            # Get PIDs
+            list.append(svinfo.getInfo(iServiceInformation.sVideoPID))
+            list.append(svinfo.getInfo(iServiceInformation.sAudioPID))
+            list.append(svinfo.getInfo(iServiceInformation.sPCRPID))
+            list.append(svinfo.getInfo(iServiceInformation.sPMTPID))
+            list.append(svinfo.getInfo(iServiceInformation.sTXTPID))
+            list.append(svinfo.getInfo(iServiceInformation.sTSID))
+            list.append(svinfo.getInfo(iServiceInformation.sONID))
+            list.append(svinfo.getInfo(iServiceInformation.sSID))
+        else:
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            list.append("N/A")
+            
         print list
         
         listR = []
index 87d1619..d5fd986 100644 (file)
@@ -23,7 +23,7 @@ sessions = [ ]
        define all files in /web to send no  XML-HTTP-Headers here
        all files not listed here will get an Content-Type: application/xhtml+xml charset: UTF-8
 """
-AppTextHeaderFiles = ['stream.m3u.xml','ts.m3u.xml',] 
+AppTextHeaderFiles = ['stream.m3u.xml','ts.m3u.xml','wapwrapper.xml',
 
 """
  Actualle, the TextHtmlHeaderFiles should contain the updates.html.xml, but the IE then
@@ -36,7 +36,7 @@ TextHtmlHeaderFiles = []
        all files not listed here will get an Content-Type: text/html charset: UTF-8
 """
 NoExplicitHeaderFiles = ['getpid.xml','tvbrowser.xml',] 
+
 """
  set DEBUG to True, if twisted should write logoutput to a file.
  in normal console output, twisted will print only the first Traceback.
@@ -47,7 +47,7 @@ NoExplicitHeaderFiles = ['getpid.xml','tvbrowser.xml',]
                        
 
 DEBUG = True
-DEBUG = False
+#DEBUG = False
 DEBUGFILE= "/tmp/twisted.log"
 
 from twisted.cred.portal import Portal
@@ -101,8 +101,8 @@ def startWebserver():
                                webif.renderPage(s, self.path, req, sessions[0])  # login?
                                if self.path.split("/")[-1] in AppTextHeaderFiles:
                                        return http.Response(responsecode.OK,{'Content-type': http_headers.MimeType('application', 'text', (('charset', 'UTF-8'),))},stream=s)
-#                              elif self.path.split("/")[-1] in TextHtmlHeaderFiles:
-#                                      return http.Response(responsecode.OK,{'Content-type': http_headers.MimeType('text', 'html', (('charset', 'UTF-8'),))},stream=s)
+                               elif self.path.split("/")[-1] in TextHtmlHeaderFiles:
+                                       return http.Response(responsecode.OK,{'Content-type': http_headers.MimeType('text', 'html', (('charset', 'UTF-8'),))},stream=s)
                                elif self.path.split("/")[-1] in NoExplicitHeaderFiles:
                                        return http.Response(responsecode.OK,stream=s)
                                else:
diff --git a/webinterface/src/web-data/gfx/remotecontrol_static.jpg b/webinterface/src/web-data/gfx/remotecontrol_static.jpg
new file mode 100644 (file)
index 0000000..6df810a
Binary files /dev/null and b/webinterface/src/web-data/gfx/remotecontrol_static.jpg differ
index c4f7c1b..b205b2d 100644 (file)
@@ -105,6 +105,7 @@ thead.fixedHeader a:hover {
 html>body tbody.scrollContent {
        display: block;
        height: 422px;
+       // This is realy bad for resolution below 1280x1024
        overflow: auto;
        width: 100%;
 }
index 4938c6f..244ac30 100644 (file)
@@ -1,5 +1,5 @@
 var DBG = true;
-DBG = false;
+//DBG = false;
 
 var url_getvolume = '/web/vol?set=state'; 
 var url_setvolume = '/web/vol?set=set'; // plus new value eq. set=set15
@@ -1582,6 +1582,7 @@ function showAbout() {
 }
 function incomingAbout(request) {
        if(request.readyState == 4){
+               debug("incomingAbout returned");
                var aboutEntries = getXML(request).getElementsByTagName("e2abouts").item(0).getElementsByTagName("e2about");
                for (var c =0; c < aboutEntries.length;c++){
                        var xml = aboutEntries.item(c);
@@ -1601,30 +1602,28 @@ function incomingAbout(request) {
                                        ,'serviceAspect': xml.getElementsByTagName('e2serviceaspect').item(0).firstChild.data
                                        ,'serviceNamespace': xml.getElementsByTagName('e2servicenamespace').item(0).firstChild.data
                                        ,'vPID': xml.getElementsByTagName('e2vpid').item(0).firstChild.data
-                                        ,'vPIDh': parseInt(xml.getElementsByTagName('e2vpid').item(0).firstChild.data,16)
-                                       ,'aPID': xml.getElementsByTagName('e2apid').item(0).firstChild.data
-                                        ,'aPIDh': parseInt(xml.getElementsByTagName('e2apid').item(0).firstChild.data,16)
+                                        ,'vPIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2vpid').item(0).firstChild.data),16)+" "
+                                       ,'aPID': xml.getElementsByTagName('e2apid').item(0).firstChild.data+" "
+                                        ,'aPIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2apid').item(0).firstChild.data),16)+" "
                                        ,'pcrID': xml.getElementsByTagName('e2pcrid').item(0).firstChild.data
-                                        ,'pcrIDh': parseInt(xml.getElementsByTagName('e2pcrid').item(0).firstChild.data,16)
+                                        ,'pcrIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2pcrid').item(0).firstChild.data),16)+" "
                                        ,'pmtPID': xml.getElementsByTagName('e2pmtpid').item(0).firstChild.data
-                                        ,'pmtPIDh': parseInt(xml.getElementsByTagName('e2pmtpid').item(0).firstChild.data,16)
+                                        ,'pmtPIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2pmtpid').item(0).firstChild.data),16)+" "
                                        ,'txtPID': xml.getElementsByTagName('e2txtpid').item(0).firstChild.data
-                                        ,'txtPIDh': parseInt(xml.getElementsByTagName('e2txtpid').item(0).firstChild.data,16)
+                                        ,'txtPIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2txtpid').item(0).firstChild.data),16)+" "
                                        ,'tsID': xml.getElementsByTagName('e2tsid').item(0).firstChild.data
-                                        ,'tsIDh': parseInt(xml.getElementsByTagName('e2tsid').item(0).firstChild.data,16)
+                                        ,'tsIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2tsid').item(0).firstChild.data),16)+" "
                                        ,'onID': xml.getElementsByTagName('e2onid').item(0).firstChild.data
-                                        ,'onIDh': parseInt(xml.getElementsByTagName('e2onid').item(0).firstChild.data,16)
+                                        ,'onIDh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2onid').item(0).firstChild.data),16)+" "
                                        ,'sid': xml.getElementsByTagName('e2sid').item(0).firstChild.data
-                                        ,'sidh': parseInt(xml.getElementsByTagName('e2sid').item(0).firstChild.data,16)
+                                        ,'sidh': parseInt(ownLazyNumber(xml.getElementsByTagName('e2sid').item(0).firstChild.data),16)+" "
                                  };
                                document.getElementById('BodyContentChannellist').innerHTML = RND(tplAbout, namespace);;
                                setBodyMainContent('BodyContentChannellist');
+                               
                        } catch (e) {
-                               debug("About parsing Error");
+                               debug("About parsing Error" + e);
                        }       
                }
-               
        }
-               
-       
 }
diff --git a/webinterface/src/web/wapwrapper.xml b/webinterface/src/web/wapwrapper.xml
new file mode 100644 (file)
index 0000000..c26911d
--- /dev/null
@@ -0,0 +1 @@
+<e2:screen name="WAPwrapper"><e2:element source="redirect"><e2:convert type="web:TextToHTML" /></e2:element></e2:screen>
index 1d3944a..1630fc0 100644 (file)
@@ -128,7 +128,18 @@ class TsM3U(WebScreen):
                from Components.config import config
                self["file"] = StaticText()
                self["localip"] = RequestData(request,what=RequestData.HOST)
+
+class WAPwrapper(WebScreen):
+       def __init__(self, session,request):
+               WebScreen.__init__(self, session,request)
+               from Components.Sources.Config import Config
                
+               from Components.Sources.StaticText import StaticText
+               self["redirect"] = StaticText()
+               print "request",request
+               for eachKey in self:
+                       print "eachKey",eachKey
+                               
 class RestartTwisted(WebScreen):
        def __init__(self, session,request):
                WebScreen.__init__(self, session,request)
@@ -397,6 +408,8 @@ def renderPage(stream, path, req, session):
        parser = make_parser()
        parser.setFeature(feature_namespaces, 0)
        parser.setContentHandler(handler)
+       print "__file__: ",__file__
+       print "path: ",path
        parser.parse(open(util.sibpath(__file__, path)))
        
        # by default, we have non-streaming pages