moved FanControl2 WebIF data files
authorJörg Trahm <joergm6@online.de>
Thu, 13 Jan 2011 23:04:00 +0000 (00:04 +0100)
committerJörg Trahm <joergm6@online.de>
Thu, 13 Jan 2011 23:04:00 +0000 (00:04 +0100)
25 files changed:
configure.ac
fancontrol2/src/FC2webSite.py
fancontrol2/src/Makefile.am
fancontrol2/src/data/FC2Chart.png [new file with mode: 0644]
fancontrol2/src/data/FC2Info.png [new file with mode: 0644]
fancontrol2/src/data/FC2Setup.png [new file with mode: 0644]
fancontrol2/src/data/FC2dreambox.png [new file with mode: 0644]
fancontrol2/src/data/FC2hdd.png [new file with mode: 0644]
fancontrol2/src/data/FC2on.png [new file with mode: 0644]
fancontrol2/src/data/FC2record.png [new file with mode: 0644]
fancontrol2/src/data/Makefile.am [new file with mode: 0644]
fancontrol2/src/data/diagram.class.org [new file with mode: 0644]
fancontrol2/src/globals.py [new file with mode: 0644]
fancontrol2/src/plugin.py
fancontrol2/src/webif/FC2web.py [deleted file]
fancontrol2/src/webif/Makefile.am [deleted file]
fancontrol2/src/webifdata/FC2Chart.png [deleted file]
fancontrol2/src/webifdata/FC2Info.png [deleted file]
fancontrol2/src/webifdata/FC2Setup.png [deleted file]
fancontrol2/src/webifdata/FC2dreambox.png [deleted file]
fancontrol2/src/webifdata/FC2hdd.png [deleted file]
fancontrol2/src/webifdata/FC2on.png [deleted file]
fancontrol2/src/webifdata/FC2record.png [deleted file]
fancontrol2/src/webifdata/Makefile.am [deleted file]
fancontrol2/src/webifdata/diagram.class.org [deleted file]

index b0ccc01..97ec337 100644 (file)
@@ -158,8 +158,7 @@ fancontrol2/Makefile
 fancontrol2/meta/Makefile
 fancontrol2/po/Makefile
 fancontrol2/src/Makefile
-fancontrol2/src/webif/Makefile
-fancontrol2/src/webifdata/Makefile
+fancontrol2/src/data/Makefile
 
 filebrowser/Makefile
 filebrowser/meta/Makefile
index e39fc23..d96a8e8 100644 (file)
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 from twisted.web import resource, http
+from globals import *
 from plugin import *
 from Sensors import sensors
 from __init__ import _
@@ -36,14 +37,14 @@ class FC2web(resource.Resource):
                html += "<body bgcolor=\"#666666\" text=\"#FFFFFF\">\n"
                html += "<form method=\"POST\" action=\"--WEBBOT-SELF--\">\n"
                html += "<table border=\"1\" width=\"500\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\" cellspacing=\"1\"><tr><td bgcolor=\"#000000\" width=\"200\">\n"
-               html += "<p align=\"center\"><img border=\"0\" src=\"/web-data/fc2/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
+               html += "<p align=\"center\"><img border=\"0\" src=\"/fancontrol/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
                html += "<font color=\"#FFFFFF\"><BR><b>Fan Control 2 - Info</b></font></p>\n"
                html += "</td><td bgcolor=\"#000000\">\n"
                html += "<p align=\"right\">"
                html += BoxStatus()
                if os.path.exists(config.plugins.FanControl.LogPath.value + "FC2data.csv"):
-                       html += "<a href=\"/fancontrol/chart\"><img border=\"0\" src=\"/web-data/fc2/FC2Chart.png\" width=\"100\" height=\"40\"></a>\n"
-               html += "<a href=\"/fancontrol/log\"><img border=\"0\" src=\"/web-data/fc2/FC2Setup.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
+                       html += "<a href=\"/fancontrol/chart\"><img border=\"0\" src=\"/fancontrol/FC2Chart.png\" width=\"100\" height=\"40\"></a>\n"
+               html += "<a href=\"/fancontrol/log\"><img border=\"0\" src=\"/fancontrol/FC2Setup.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
                html += "<table border=\"1\" width=\"500\" id=\"table1\">\n"
                html += "<tr>\n"
                html += "<td>%s: <b><font color=\"#FFCC00\">%4.1f °C</font></b></td>\n" % (_("Temperature"),FC2werte[0])
@@ -127,14 +128,14 @@ class FC2webLog(resource.Resource):
                        html += "</head>"
                        html += "<body bgcolor=\"#666666\" text=\"#FFFFFF\">\n"
                        html += "<table border=\"1\" width=\"500\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\" cellspacing=\"1\"><tr><td bgcolor=\"#000000\" width=\"200\">\n"
-                       html += "<p align=\"center\"><img border=\"0\" src=\"/web-data/fc2/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
+                       html += "<p align=\"center\"><img border=\"0\" src=\"/fancontrol/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
                        html += "<font color=\"#FFFFFF\"><BR><b>Fan Control 2 - Logging</b></font></p>\n"
                        html += "</td><td bgcolor=\"#000000\">\n"
                        html += "<p align=\"right\">"
                        html += BoxStatus()
                        if os.path.exists(config.plugins.FanControl.LogPath.value + "FC2data.csv"):
-                               html += "<a href=\"/fancontrol/chart\"><img border=\"0\" src=\"/web-data/fc2/FC2Chart.png\" width=\"100\" height=\"40\"></a>\n"
-                       html += "<a href=\"/fancontrol\"><img border=\"0\" src=\"/web-data/fc2/FC2Info.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
+                               html += "<a href=\"/fancontrol/chart\"><img border=\"0\" src=\"/fancontrol/FC2Chart.png\" width=\"100\" height=\"40\"></a>\n"
+                       html += "<a href=\"/fancontrol\"><img border=\"0\" src=\"/fancontrol/FC2Info.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
 
                        html += "<table border=\"1\" width=\"500\">"
                        html += "<tr><td width=\"50%\" align=\"center\" valign=\"top\">Data Logging "
@@ -383,16 +384,16 @@ class FC2webChart(resource.Resource):
                        html += "</head>"
                        html += "<body bgcolor=\"#666666\" text=\"#FFFFFF\">\n"
                        html += "<table border=\"1\" width=\"900\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\"  cellspacing=\"1\"><tr><td bgcolor=\"#000000\" width=\"200\">\n"
-                       html += "<p align=\"center\"><img border=\"0\" src=\"/web-data/fc2/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
+                       html += "<p align=\"center\"><img border=\"0\" src=\"/fancontrol/FC2dreambox.png\" width=\"181\" height=\"10\">\n"
                        html += "<font color=\"#FFFFFF\"><BR><b>Fan Control 2 - Chart</b></font></p>\n"
                        html += "</td><td bgcolor=\"#000000\">\n"
                        html += "<p align=\"right\">"
                        html += BoxStatus()
                        if os.path.exists(config.plugins.FanControl.LogPath.value + "FC2data.csv"):
-                               html += "<a href=\"/fancontrol\"><img border=\"0\" src=\"/web-data/fc2/FC2Info.png\" width=\"100\" height=\"40\"></a>\n"
-                       html += "<a href=\"/fancontrol/log\"><img border=\"0\" src=\"/web-data/fc2/FC2Setup.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
+                               html += "<a href=\"/fancontrol\"><img border=\"0\" src=\"/fancontrol/FC2Info.png\" width=\"100\" height=\"40\"></a>\n"
+                       html += "<a href=\"/fancontrol/log\"><img border=\"0\" src=\"/fancontrol/FC2Setup.png\" width=\"100\" height=\"40\"></a></td></tr></table>\n"
 
-                       html += "<applet code=\"diagram.class\" codebase=\"/web-data/fc2/\" name=\"DiaTemp\" "
+                       html += "<applet code=\"diagram.class\" codebase=\"/fancontrol/\" name=\"DiaTemp\" "
                        html += "align=\"baseline\" width=\"900\" height=\"250\" mayscript>\n"
                        html += "<param name=\"title\" value=\"Temp  (48h - %s)\">\n" % DT[0]
                        html += "<param name=\"bgcolor\" value=\"240; 240; 240\">\n"
@@ -432,7 +433,7 @@ class FC2webChart(resource.Resource):
 #                      html += "<div style=\"position: absolute; width: 100px; height: 100px; z-index: 1; left: 910px; top: 146px\" id=\"Ebene1\">\n"
 #                      html += "<img border=\"0\" src=\"/web-data/fc2/FC2Status.png\" width=\"115\" height=\"168\"></div>\n"
 
-                       html += "<applet code=\"diagram.class\" codebase=\"/web-data/fc2/\" name=\"DiaRPM\" "
+                       html += "<applet code=\"diagram.class\" codebase=\"/fancontrol/\" name=\"DiaRPM\" "
                        html += "align=\"baseline\" width=\"900\" height=\"250\" mayscript>\n"
                        html += "<param name=\"title\" value=\"RPM  (48h - %s)\">\n" % DT[0]
                        html += "<param name=\"bgcolor\" value=\"240; 240; 240\">\n"
@@ -494,9 +495,9 @@ def BoxStatus():
        h = ""
        S = int(FC2werte[5])
        if (S & 1)>0 :
-               h += "<img border=\"0\" src=\"/web-data/fc2/FC2on.png\" width=\"20\" height=\"20\" title=\"Box On\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
+               h += "<img border=\"0\" src=\"/fancontrol/FC2on.png\" width=\"20\" height=\"20\" title=\"Box On\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
        if (S & 2)>0 :
-               h += "<img border=\"0\" src=\"/web-data/fc2/FC2hdd.png\" width=\"20\" height=\"20\" title=\"HDD On\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
+               h += "<img border=\"0\" src=\"/fancontrol/FC2hdd.png\" width=\"20\" height=\"20\" title=\"HDD On\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
        if (S & 4)>0 :
-               h += "<img border=\"0\" src=\"/web-data/fc2/FC2record.png\" width=\"20\" height=\"20\" title=\"Recording\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
+               h += "<img border=\"0\" src=\"/fancontrol/FC2record.png\" width=\"20\" height=\"20\" title=\"Recording\" align=\"left\" hspace=\"2\" vspace=\"5\">\n"
        return h
index cc9a153..bf39af3 100644 (file)
@@ -1,6 +1,6 @@
 installdir = /usr/lib/enigma2/python/Plugins/Extensions/FanControl
 
-SUBDIRS = webif webifdata
+SUBDIRS = data
 
 install_PYTHON = *.py
 install_DATA = plugin.png plugin.pot *.txt maintainer.info LICENSE
diff --git a/fancontrol2/src/data/FC2Chart.png b/fancontrol2/src/data/FC2Chart.png
new file mode 100644 (file)
index 0000000..51027f8
Binary files /dev/null and b/fancontrol2/src/data/FC2Chart.png differ
diff --git a/fancontrol2/src/data/FC2Info.png b/fancontrol2/src/data/FC2Info.png
new file mode 100644 (file)
index 0000000..a9953b6
Binary files /dev/null and b/fancontrol2/src/data/FC2Info.png differ
diff --git a/fancontrol2/src/data/FC2Setup.png b/fancontrol2/src/data/FC2Setup.png
new file mode 100644 (file)
index 0000000..50025ec
Binary files /dev/null and b/fancontrol2/src/data/FC2Setup.png differ
diff --git a/fancontrol2/src/data/FC2dreambox.png b/fancontrol2/src/data/FC2dreambox.png
new file mode 100644 (file)
index 0000000..f599616
Binary files /dev/null and b/fancontrol2/src/data/FC2dreambox.png differ
diff --git a/fancontrol2/src/data/FC2hdd.png b/fancontrol2/src/data/FC2hdd.png
new file mode 100644 (file)
index 0000000..24697cc
Binary files /dev/null and b/fancontrol2/src/data/FC2hdd.png differ
diff --git a/fancontrol2/src/data/FC2on.png b/fancontrol2/src/data/FC2on.png
new file mode 100644 (file)
index 0000000..24845ee
Binary files /dev/null and b/fancontrol2/src/data/FC2on.png differ
diff --git a/fancontrol2/src/data/FC2record.png b/fancontrol2/src/data/FC2record.png
new file mode 100644 (file)
index 0000000..36f1481
Binary files /dev/null and b/fancontrol2/src/data/FC2record.png differ
diff --git a/fancontrol2/src/data/Makefile.am b/fancontrol2/src/data/Makefile.am
new file mode 100644 (file)
index 0000000..8e6a313
--- /dev/null
@@ -0,0 +1,3 @@
+installdir = /usr/lib/enigma2/python/Plugins/Extensions/FanControl/data/
+
+install_DATA = *.png diagram.class.org
diff --git a/fancontrol2/src/data/diagram.class.org b/fancontrol2/src/data/diagram.class.org
new file mode 100644 (file)
index 0000000..3db06e5
Binary files /dev/null and b/fancontrol2/src/data/diagram.class.org differ
diff --git a/fancontrol2/src/globals.py b/fancontrol2/src/globals.py
new file mode 100644 (file)
index 0000000..821e0c2
--- /dev/null
@@ -0,0 +1,38 @@
+Version = "V2.4r4"
+# globale Variablen        
+ZielRPM = 0
+AktVLT = 0
+AktPWM = 0
+AktRPM = 0
+AktTemp = 0
+AktHDD = []
+LastVLT = 0
+LastPWM = 0
+FanFehler = 0
+OverheatTimer = 0
+Overheat = False
+FanOffWait = False
+Recording = False
+RPMread = 0
+RPMdiff = 0
+FirstStart = True
+RPMrunning = False
+istStandbySave = False
+disableHDDread = False
+session = None
+Box = ""
+DataMinute = ""
+FC2Log = []
+FC2werte = [0.1,0,0,0,0,0]
+FC2stunde = ["-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-"]
+HeadLine = "Time;Temp;RPM;VLT;PWM;HDD;Status;Temp1;Temp2;Temp3;Temp4;Temp5;Temp6;Temp7;Temp8\r\n"
+TempName = [
+       _("below Tunerslot 4"),
+       _("near XILINX Spartan"),
+       _("under the WLAN"),
+       _("left of the Battery"),
+       _("left near Front-CI"),
+       _("left near Card-Slot"),
+       _("over Security Card"),
+       _("under the Fan")
+]
index a9be39f..89bb082 100644 (file)
@@ -1,10 +1,11 @@
 # FanControl2
 # joergm6 IHAD
-Version = "V2.4r4"
 import time
 import os
 from __init__ import _
 
+from globals import *
+
 from enigma import eTimer, eSize
 
 # Config
@@ -128,44 +129,6 @@ def setPWM(fanid, value):
        f.write("%x" % value)
        f.close()
 
-# globale Variablen        
-ZielRPM = 0
-AktVLT = 0
-AktPWM = 0
-AktRPM = 0
-AktTemp = 0
-AktHDD = []
-LastVLT = 0
-LastPWM = 0
-FanFehler = 0
-OverheatTimer = 0
-Overheat = False
-FanOffWait = False
-Recording = False
-RPMread = 0
-RPMdiff = 0
-FirstStart = True
-RPMrunning = False
-istStandbySave = False
-disableHDDread = False
-session = None
-Box = ""
-DataMinute = ""
-FC2Log = []
-FC2werte = [0.1,0,0,0,0,0]
-FC2stunde = ["-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-","-"]
-HeadLine = "Time;Temp;RPM;VLT;PWM;HDD;Status;Temp1;Temp2;Temp3;Temp4;Temp5;Temp6;Temp7;Temp8\r\n"
-TempName = [
-       _("below Tunerslot 4"),
-       _("near XILINX Spartan"),
-       _("under the WLAN"),
-       _("left of the Battery"),
-       _("left near Front-CI"),
-       _("left near Card-Slot"),
-       _("over Security Card"),
-       _("under the Fan")
-]
-
 #Configuration
 config.plugins.FanControl = ConfigSubsection()
 config.plugins.FanControl.Fan = ConfigSelection(choices = [("disabled", _("disabled")), ("aus", _("Control disabled")), ("3pin", _("3Pin")), ("4pin", _("4Pin"))], default = "disabled")
@@ -832,8 +795,8 @@ class FanControl2(Screen):
                self.Fan        = "aus"
                self.dontshutdown = False
                FClog("Starting up")
-               if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/fc2/diagram.class.org"):
-                       os.rename("/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/fc2/diagram.class.org","/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/fc2/diagram.class")
+               if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/FanControl/data/diagram.class.org"):
+                       os.rename("/usr/lib/enigma2/python/Plugins/Extensions/FanControl/data/diagram.class.org","/usr/lib/enigma2/python/Plugins/Extensions/FanControl/data/diagram.class")
                if not isDMMdisabled() and config.plugins.FanControl.DisableDMM.value:
                        disableDMM()
                Box = GetBox()
@@ -1064,6 +1027,15 @@ class FanControl2(Screen):
 
 def autostart(reason, **kwargs):
        global session
+       from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
+       from FC2webSite import FC2web, FC2webLog, FC2webChart
+       from twisted.web import static
+       root = static.File("/usr/lib/enigma2/python/Plugins/Extensions/FanControl/data")
+#      root = FC2web()
+       root.putChild("", FC2web())
+       root.putChild("log", FC2webLog())
+       root.putChild("chart", FC2webChart())
+       addExternalChild( ("fancontrol", root) )
        if reason == 0 and kwargs.has_key("session"):
                session = kwargs["session"]
                session.open(FanControl2)
diff --git a/fancontrol2/src/webif/FC2web.py b/fancontrol2/src/webif/FC2web.py
deleted file mode 100644 (file)
index f474b5c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-from Plugins.Extensions.WebInterface.WebChilds.Toplevel import addExternalChild
-from Plugins.Extensions.FanControl.FC2webSite import FC2web, FC2webLog, FC2webChart
-root = FC2web()
-root.putChild("log", FC2webLog())
-root.putChild("chart", FC2webChart())
-addExternalChild( ("fancontrol", root) )
\ No newline at end of file
diff --git a/fancontrol2/src/webif/Makefile.am b/fancontrol2/src/webif/Makefile.am
deleted file mode 100644 (file)
index a669979..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-installdir = /usr/lib/enigma2/python/Plugins/Extensions/WebInterface/WebChilds/External/
-
-install_PYTHON = *.py
diff --git a/fancontrol2/src/webifdata/FC2Chart.png b/fancontrol2/src/webifdata/FC2Chart.png
deleted file mode 100644 (file)
index 51027f8..0000000
Binary files a/fancontrol2/src/webifdata/FC2Chart.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2Info.png b/fancontrol2/src/webifdata/FC2Info.png
deleted file mode 100644 (file)
index a9953b6..0000000
Binary files a/fancontrol2/src/webifdata/FC2Info.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2Setup.png b/fancontrol2/src/webifdata/FC2Setup.png
deleted file mode 100644 (file)
index 50025ec..0000000
Binary files a/fancontrol2/src/webifdata/FC2Setup.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2dreambox.png b/fancontrol2/src/webifdata/FC2dreambox.png
deleted file mode 100644 (file)
index f599616..0000000
Binary files a/fancontrol2/src/webifdata/FC2dreambox.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2hdd.png b/fancontrol2/src/webifdata/FC2hdd.png
deleted file mode 100644 (file)
index 24697cc..0000000
Binary files a/fancontrol2/src/webifdata/FC2hdd.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2on.png b/fancontrol2/src/webifdata/FC2on.png
deleted file mode 100644 (file)
index 24845ee..0000000
Binary files a/fancontrol2/src/webifdata/FC2on.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/FC2record.png b/fancontrol2/src/webifdata/FC2record.png
deleted file mode 100644 (file)
index 36f1481..0000000
Binary files a/fancontrol2/src/webifdata/FC2record.png and /dev/null differ
diff --git a/fancontrol2/src/webifdata/Makefile.am b/fancontrol2/src/webifdata/Makefile.am
deleted file mode 100644 (file)
index 5a05f2f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-installdir = /usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/fc2/
-
-install_DATA = *.png diagram.class.org
diff --git a/fancontrol2/src/webifdata/diagram.class.org b/fancontrol2/src/webifdata/diagram.class.org
deleted file mode 100644 (file)
index 3db06e5..0000000
Binary files a/fancontrol2/src/webifdata/diagram.class.org and /dev/null differ