Skip to content

Commit f678ce7

Browse files
authored
Merge pull request #1 from Hains/python3
Update LCD4Linux
2 parents 831070c + d202995 commit f678ce7

File tree

5 files changed

+341
-397
lines changed

5 files changed

+341
-397
lines changed

lcd4linux/src/WebConfigSite.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ class LCD4linuxConfigweb(resource.Resource):
7676

7777
def __init__(self):
7878
self.StatusTimer = eTimer()
79-
if DPKG:
80-
self.StatusTimer_conn = self.StatusTimer.timeout.connect(self.resetWeb)
81-
else:
82-
self.StatusTimer.callback.append(self.resetWeb)
79+
self.StatusTimer.callback.append(self.resetWeb)
8380
self.CurrentMode = ("-", "-")
8481

8582
def resetWeb(self):
@@ -328,7 +325,6 @@ def action(self, req):
328325
obja = eval(a)
329326
objb = eval(b)
330327
objb.value = obja.value
331-
332328
elif ".Standby" in _a:
333329
b = _a.replace(".Standby", ".")
334330
if (" " + b) in list(zip(*L2))[2]:
@@ -428,7 +424,8 @@ def action(self, req):
428424
if Cfritz:
429425
rmFile(PICfritz)
430426
if Cwetter:
431-
resetWetter(None)
427+
# resetWetter(None) # action after changing weather parameters
428+
pass
432429
if Cpicon:
433430
if len(LCD4linux.PiconCache.value) > 2:
434431
rmFiles(join(LCD4linux.PiconCache.value, "*.png"))
@@ -508,18 +505,14 @@ def action(self, req):
508505
html += "<input type=\"image\" name=\"save\" value=\"klick\" src=\"/lcd4linux/data/WEBsave.png\" height=\"40\" title=\"%s\" class=\"style1\" >\n" % _l(_("Save Config"))
509506
html += "</form>\n"
510507
html += "<form method=\"post\"><font color=\"#FFFFFF\">%s</font>\n" % _l(_("Screen"))
511-
512508
html += "<input type=\"hidden\" name=\"cmd\" value=\"\">\n"
513509
for i in range(1, 10):
514510
html += "<input type=\"button\" value=\"%d\" style=\"width:15px; text-align:center; font-size:8pt%s\" onclick=\"this.form.cmd.value = 'Screen%d'; this.form.submit();\">\n" % (i, AktiveScreen(str(i)), i)
515-
516511
Aktiv = "checked" if getSaveEventListChanged() else ""
517512
html += "<input type=\"hidden\" name=\"hold\" value=\"%s\">" % ("unchecked")
518513
html += "<input type=\"checkbox\" title=\"%s\" name=\"hold\" value=\"%s\" onclick=\"this.form.cmd.value = 'hold'; this.form.submit();\" %s>" % (_l(_("stop Screencycle")), "checked", Aktiv)
519-
520514
html += "</form>\n"
521515
html += "</td></tr></table>\n"
522-
523516
html += "<form method=\"get\">"
524517
html += "<fieldset style=\"width:auto\" name=\"Mode1\">"
525518
html += "<legend style=\"color: #FFCC00\">%s&nbsp;</legend>\n" % _l(_("Mode"))
@@ -532,7 +525,6 @@ def action(self, req):
532525
if str(LCD4linux.Popup.value) != "0":
533526
html += "<input id=\"r5\" name=\"Mode\" type=\"radio\" value=\"5\" %s onclick=\"this.form.submit();\"><label %s for=\"r5\">%s&nbsp;&nbsp;</label>\n" % (AktiveMode("5", "Popup-Text"))
534527
html += "</fieldset></form>\n"
535-
536528
if Mode != "5":
537529
if Mode == "1":
538530
L = L1
@@ -595,9 +587,7 @@ def action(self, req):
595587
for LL in L:
596588
Conf = LL[2].strip()
597589
ConfObj = eval(Conf)
598-
599590
if (Conf.startswith(Element) and (LL[3] == AktCode or AktCode == 0)) or (Element == "other" and LL[3] == 0):
600-
601591
if Mode in "2":
602592
if "." in Conf:
603593
b = Conf.replace(".", ".MP")

lcd4linux/src/configOptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
['self.list1', 'MJPEG Cycle', ' LCD4linux.MJPEGCycle', 14],
190190
['self.list1', 'MJPEG Restart on Error', ' LCD4linux.MJPEGRestart', 14],
191191
['self.list1', 'MJPEG Header Mode', ' LCD4linux.MJPEGHeader', 14],
192+
['self.list1', 'Show Streams \'4097; 5001...5003\' in Mode', ' LCD4linux.Streaming', 0],
192193
['self.list1', 'Sonos IP', ' LCD4linux.SonosIP', 19],
193194
['self.list1', 'Sonos Ping Timeout [ms]', ' LCD4linux.SonosPingTimeout', 19],
194195
['self.list1', 'Sonos Play Check', ' LCD4linux.SonosCheckTimer', 19],

lcd4linux/src/data/skin_data.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
<screen name="SimpleSummary" position="fill" id="3">
4949
<panel name="SummaryTemplate" />
5050
</screen>
51+
<!--ScreenSummary-->
52+
<screen name="ScreenSummary" position="fill" id="3">
53+
<panel name="SummaryTemplate" />
54+
</screen>
5155
<!--ChannelSelectionRadio_summary-->
5256
<screen name="ChannelSelectionRadio_summary" position="fill" id="3">
5357
<panel name="SummaryTemplate" />

lcd4linux/src/module.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# by joergm6 @ IHAD
44
# for documentation look at IHAD Support Thread
55

6+
from __future__ import print_function
67
from os import popen
78
from os.path import isfile, exists
89

@@ -53,7 +54,7 @@ def get(self, element=None):
5354
def web(self, EX):
5455
try:
5556
exec("self.add('%s)" % EX.replace(",", "',", 1))
56-
except:
57+
except Exception:
5758
print("[LCD4linuxE] Error: L4L Web-Elements")
5859

5960
def getResolution(self, LCD):
@@ -109,7 +110,7 @@ def setScreen(self, S, Lcd="", Hold=False):
109110
L4Lelement.Hold = Hold
110111
L4Lelement.Refresh = True
111112

112-
def resetBrightness(self, AKT=[]):
113+
def resetBrightness(self, AKT=""):
113114
if len(AKT) == 3:
114115
L4Lelement.BrightAkt = AKT
115116
else:
@@ -122,10 +123,10 @@ def setBrightness(self, LCD, BRI=-1):
122123
L4Lelement.Refresh = True
123124

124125
def getBrightness(self, LCD=0, ORG=True):
125-
if LCD > 0 and LCD < 4:
126-
return L4Lelement.Bright[LCD - 1] if ORG == False else L4Lelement.BrightAkt[LCD - 1]
126+
if int(LCD) > 0 and int(LCD) < 4:
127+
return L4Lelement.Bright[int(LCD) - 1] if ORG == False else L4Lelement.BrightAkt[int(LCD) - 1]
127128
else:
128-
return L4Lelement.Bright[0] if ORG == False else L4Lelement.BrightAkt[0]
129+
return L4Lelement.Bright if ORG == False else L4Lelement.BrightAkt
129130

130131
def getLcd(self):
131132
return L4Lelement.LCD
@@ -146,7 +147,7 @@ def getstatusoutput(cmd):
146147
sts = 0
147148
if text[-1:] == '\n':
148149
text = text[:-1]
149-
except:
150+
except Exception:
150151
sts = 1
151152
text = "- -"
152153
print("[LCD4linux] Error on os-call")
@@ -173,6 +174,6 @@ def L4LVtest(VV):
173174
f = open(L4Linfo % (O, P))
174175
OO = f.readline().strip().split()[1].startswith(VV[1:])
175176
f.close()
176-
except:
177+
except Exception:
177178
pass
178179
return OO

0 commit comments

Comments
 (0)