Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install python 3.11
- name: Install python 3.14
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.14'
- name: Install python packages
run: |
pip install flake8
- name: Install dev packages
run: |
sudo apt install gettext python3.11-dev
sudo apt install gettext python3.14-dev libtirpc-dev
- name: Build plugins
env:
CC: "gcc-10"
CXX: "g++-10"
CC: "gcc-15"
CXX: "g++-15"
run: |
autoreconf -i
./configure CFLAGS=-I/usr/include/tirpc
Expand Down
10 changes: 5 additions & 5 deletions lcd4linux/src/Photoframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from usb.util import get_string
from PIL import Image
from struct import pack
from six.moves import cStringIO as StringIO
from io import StringIO


def write_jpg2frame(dev, pic):
Expand Down Expand Up @@ -162,12 +162,12 @@ def frame_init(dev):

def frame_switch(dev):
# Switch device from Mass Storage to Mini Monitor
CTRL_TYPE_VENDOR = (2 << 5)
CTRL_IN = 0x80
CTRL_RECIPIENT_DEVICE = 0
# CTRL_TYPE_VENDOR = (2 << 5)
# CTRL_IN = 0x80
# CTRL_RECIPIENT_DEVICE = 0
try:
sleep(0.5)
s = "\x00" * 251
# s = "\x00" * 251
dev.ctrl_transfer(0x00 | 0x80, 0x06, 0xfe, 0xfe, 0xfe)
# dev.ctrl_transfer(0x00 | 0x80, 0x06, 0xfe, 0xfe, s, 0xfe )
# dev.ctrl_transfer(CTRL_TYPE_VENDOR | CTRL_IN | CTRL_RECIPIENT_DEVICE, 0x04, 0x00, 0x00, 1)
Expand Down
68 changes: 36 additions & 32 deletions lcd4linux/src/WebConfigSite.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from glob import glob
from os import stat
from os.path import isfile, join, basename
from six import PY2, ensure_str, ensure_binary
from time import time
from twisted.web import resource, http
if PY2:
from HTMLParser import HTMLParser
_unescape = HTMLParser().unescape
else:
from html import unescape as _unescape
from html import unescape as _unescape

from enigma import eTimer
from Components.config import ConfigSelection, ConfigYesNo, ConfigText, ConfigSlider, ConfigClock, ConfigPassword
Expand All @@ -35,16 +29,26 @@
L4LElement = L4Lelement()


def ensure_binary(s):
if isinstance(s, str):
return s.encode("utf-8")
return s


def ensure_str(s):
if isinstance(s, bytes):
return s.decode("utf-8")
return s


def _exec(command):
if PY2:
exec(command)
else:
variable = command.split(" ", 1)[0]
exec("global %s;%s" % (variable, command))
variable = command.split(" ", 1)[0]
exec("global %s;%s" % (variable, command))


def _l(st):
st = ensure_str(st, "utf-8", "ignore")
if isinstance(st, bytes):
st = st.decode("utf-8", "ignore")
st = st.replace(" [ok]>", "").encode('ascii', 'xmlcharrefreplace')
return ensure_str(st)

Expand Down Expand Up @@ -181,7 +185,7 @@ def action(self, req):
req.setHeader('Content-Disposition', 'attachment;filename=lcd4config')
req.setHeader('Content-Length', str(stat(lcd4config).st_size))
req.setHeader('charset', 'UTF-8')
with open(lcd4config, "r") as f:
with open(lcd4config) as f:
html = f.read()
return ensure_binary(html)
if req.args.get(b"upload.y", None) is not None:
Expand Down Expand Up @@ -210,7 +214,7 @@ def action(self, req):
req.setHeader('Content-Disposition', 'attachment;filename=l4log.txt')
req.setHeader('Content-Length', str(stat(lcd4config).st_size))
req.setHeader('charset', 'UTF-8')
with open(lcd4config, "r") as f:
with open(lcd4config) as f:
html = f.read()
return ensure_binary(html)
if command is None:
Expand All @@ -226,7 +230,7 @@ def action(self, req):
V = _l(req.args.get(b"PopText", "")[0])
try:
V = _unescape(V)
except Exception as e:
except Exception:
L4log("WebIF Error: Parse Text")
setPopText(V)
L4LElement.setRefresh()
Expand Down Expand Up @@ -334,31 +338,31 @@ def action(self, req):
if _a.find(".") > 0:
val = req.args.get(a, "")[0]
val = ensure_str(val)
#ConfigSelection
# ConfigSelection
ConfObj = eval(_a)
if isinstance(ConfObj, ConfigSelection):
ConfObj.value = val
else:
#ConfigYesNo
# ConfigYesNo
if isinstance(ConfObj, ConfigYesNo):
val = req.args.get(a, "")
ConfObj.value = True if len(val) == 2 else False
else:
#ConfigText
# ConfigText
if isinstance(ConfObj, ConfigText):
V = _l(val)
try:
V = _unescape(V)
except Exception as e:
except Exception:
L4log("WebIF Error: Parse Text")
ConfObj.value = V
else:
#ConfigSlider
# ConfigSlider
if isinstance(ConfObj, ConfigSlider):
if val.isdigit():
ConfObj.value = val
else:
#ConfigClock
# ConfigClock
if isinstance(ConfObj, ConfigClock):
t = val.split(":")
if len(t) == 2 and t[0].isdigit() and t[1].isdigit():
Expand Down Expand Up @@ -411,7 +415,7 @@ def action(self, req):
if Cfritz:
rmFile(PICfritz)
if Cwetter:
# resetWetter(None) # action after changing weather parameters
# resetWetter(None) # action after changing weather parameters
pass
if Cpicon:
if len(LCD4linux.PiconCache.value) > 2:
Expand All @@ -438,7 +442,7 @@ def action(self, req):
html += "<script language=\"JavaScript\">\n"
html += "function fensterchen() {\n"
html += "fens1=window.open(\"\", \"Crashlog\",\"width=500,height=300,resizable=yes\");\n"
for line in open(CrashFile, "r").readlines():
for line in open(CrashFile).readlines():
html += "fens1.document.write('%s');\n" % line.replace("\n", "<br>").replace("'", "\\'")
html += "} </script>\n"
html += "<style type=\"text/css\">\n"
Expand All @@ -457,8 +461,8 @@ def action(self, req):
html += "<table border=\"1\" rules=\"groups\" width=\"100%\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\" cellspacing=\"0\">"
html += "<tr><td bgcolor=\"#000000\" width=\"220\">\n"
html += "<p align=\"center\"><img title=\"\" border=\"0\" src=\"/lcd4linux/data/WEBdreambox.png\" width=\"181\" height=\"10\">\n"
CCM = "#FFFFFF" if getConfigMode() == False else "#FFCC00"
html += "<font color=\"%s\"><b>LCD4linux Config</b></font><br />%s\n" % (CCM, (Version if L4LElement.getVersion() == True else Version + "") + " (%s: Py" + ("2" if PY2 else "3") + ")") % _l(_("Mode"))
CCM = "#FFFFFF" if getConfigMode() is False else "#FFCC00"
html += "<font color=\"%s\"><b>LCD4linux Config</b></font><br />%s\n" % (CCM, (Version if L4LElement.getVersion() is True else Version + "") + " (%s: Py" + ("3") + ")") % _l(_("Mode"))
if IP is None:
html += "<br><span style=\"font-size:7pt;color: #FF0000\">%s!</span>" % _l(_("IP seurity not supported by Box"))
html += "</p></td><td bgcolor=\"#000000\">\n"
Expand Down Expand Up @@ -600,7 +604,7 @@ def action(self, req):
if AktCode == 0:
AktCode = LL[3]
Curr = ConfObj.value
#ConfigSelection
# ConfigSelection
html += "<tr>\n"
if isinstance(ConfObj, ConfigSelection):
html += "<td width=\"300\">%s</td><td>\n" % _l(_(LL[1]))
Expand All @@ -614,29 +618,29 @@ def action(self, req):
html += "</select>\n"
html += "</td>\n"
else:
#ConfigYesNo
# ConfigYesNo
if isinstance(ConfObj, ConfigYesNo):
html += "<td width=\"300\">%s</td><td>\n" % _l(_(LL[1]))
Aktiv = "checked" if Curr else ""
html += "<input type=\"hidden\" name=\"%s\" value=\"%s\">" % (Conf, "unchecked")
html += "<input type=\"checkbox\" name=\"%s\" value=\"%s\" %s>" % (Conf, "checked", Aktiv)
html += "</td>\n"
else:
#ConfigText
# ConfigText
if isinstance(ConfObj, ConfigText):
html += "<td width=\"300\">%s</td><td>\n" % _l(_(LL[1]))
html += "<input type=\"password\" name=\"%s\" size=\"60\" value=\"%s\">" % (Conf, _l(Curr)) if isinstance(ConfObj, ConfigPassword) else "<input type=\"text\" name=\"%s\" size=\"60\" value=\"%s\">" % (Conf, _l(Curr))
html += "</td>\n"
else:
#ConfigSlider
# ConfigSlider
if isinstance(ConfObj, ConfigSlider):
Min = ConfObj.min
Max = ConfObj.max
html += "<td width=\"300\">%s (%d - %d)</td><td>\n" % (_l(_(LL[1])), Min, Max)
html += "<input type=\"text\" name=\"%s\" size=\"5\" value=\"%s\">" % (Conf, Curr)
html += "</td>\n"
else:
#ConfigClock
# ConfigClock
if isinstance(ConfObj, ConfigClock):
html += "<td width=\"300\">%s</td><td>\n" % _l(_(LL[1]))
html += "<input type=\"text\" name=\"%s\" size=\"6\" value=\"%02d:%02d\">" % (Conf, Curr[0], Curr[1])
Expand Down Expand Up @@ -674,7 +678,7 @@ def action(self, req):
html += "Brightness org/set %s/%s<br />\n" % (str(L4LElement.getBrightness()), str(L4LElement.getBrightness(0, False)))

html += "<hr><span style=\"font-size:8pt\">%s (%s)</span>" % (getINFO(), IP)
html += "<BR><a style=\"font-size:10pt; color:#FFCC00;\" href=\"http://www.i-have-a-dreambox.com/wbb2/thread.php?postid=1634882\">Support & FAQ & Info & Donation</a>"
html += "<BR><a style=\"font-size:10pt; color:#FFCC00;\" href=\"https://www.opena.tv/viewtopic.php?t=73\">Support & FAQ & Info & Donation</a>"
if len(L4LElement.get()) > 0:
html += "<script language=\"JavaScript\">\n"
html += "function Efensterchen() {\n"
Expand Down
17 changes: 14 additions & 3 deletions lcd4linux/src/WebSite.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import division
from os.path import isfile, getmtime
from six import ensure_str, ensure_binary
from twisted.web import resource
from .plugin import getConfigMode, getTMPL, LCD4linux


def ensure_str(s):
if isinstance(s, bytes):
return s.decode("utf-8")
return s


def ensure_binary(s):
if isinstance(s, str):
return s.encode("utf-8")
return s


class LCD4linuxweb(resource.Resource):

title = "LCD4Linux Webinterface"
Expand All @@ -17,7 +28,7 @@ def __init__(self):
def render(self, req):
req.setHeader('Content-type', 'text/html')
req.setHeader('charset', 'UTF-8')
# rendering server response
# rendering server response
w = ""
command = req.args.get(b"width", None)
if command is not None:
Expand Down
2 changes: 2 additions & 0 deletions lcd4linux/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ def _(txt):

localeInit()
language.addCallback(localeInit)

__version__ = "5.0.40"
3 changes: 0 additions & 3 deletions lcd4linux/src/aarch64/Makefile.am

This file was deleted.

Binary file removed lcd4linux/src/aarch64/dpflib.so
Binary file not shown.
3 changes: 0 additions & 3 deletions lcd4linux/src/armv7a/Makefile.am

This file was deleted.

Binary file removed lcd4linux/src/armv7a/dpflib.so
Binary file not shown.
3 changes: 0 additions & 3 deletions lcd4linux/src/armv7ahf/Makefile.am

This file was deleted.

Binary file removed lcd4linux/src/armv7ahf/dpflib.so
Binary file not shown.
4 changes: 2 additions & 2 deletions lcd4linux/src/bluesound.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from six.moves.urllib.request import urlopen
from urllib.request import urlopen
from xml.etree.ElementTree import fromstring


Expand Down Expand Up @@ -34,7 +34,7 @@ def getStatus(self):
return r
else:
return {}
except:
except Exception:
print("Bluesound Error")
from traceback import format_exc
print("Error: %s" % format_exc())
Expand Down
3 changes: 1 addition & 2 deletions lcd4linux/src/configOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@
['self.list1', 'Background-Picture Type', ' LCD4linux.BilderBackground', 3],
['self.list1', 'Weather API', ' LCD4linux.WetterApi', 4],
['self.list1', 'Weather API-Key OpenWeatherMap', ' LCD4linux.WetterApiKeyOpenWeatherMap', 4],
['self.list1', 'Weather API-ID Key WeatherUnlocked', ' LCD4linux.WetterApiKeyWeatherUnlocked', 4],
['self.list1', 'Weather City', ' LCD4linux.WetterCity', 4],
['self.list1', 'Weather City 2', ' LCD4linux.Wetter2City', 4],
['self.list1', 'Weather-Icon-Path [ok]>', ' LCD4linux.WetterPath', 4],
['self.list1', 'Weather-Icon Zoom', ' LCD4linux.WetterIconZoom', 4],
['self.list1', 'Weather Low Temperature Color', ' LCD4linux.WetterLowColor', 4],
['self.list1', 'Weather High Temperature Color', ' LCD4linux.WetterHighColor', 4],
['self.list1', 'Weather Low Temperature Color', ' LCD4linux.WetterLowColor', 4],
['self.list1', 'Weather Transparency', ' LCD4linux.WetterTransparenz', 4],
['self.list1', 'Weather Wind speed unit', ' LCD4linux.WetterWind', 4],
['self.list1', 'Weather Wind Info Lines', ' LCD4linux.WetterWindLines', 4],
Expand Down
3 changes: 0 additions & 3 deletions lcd4linux/src/cortexa9hf/Makefile.am

This file was deleted.

Binary file removed lcd4linux/src/cortexa9hf/dpflib.so
Binary file not shown.
2 changes: 1 addition & 1 deletion lcd4linux/src/data/default.colorlcd800
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ config.LCDType1=50
config.xmlLCDType=800x480
config.xmlType01=true
config.xmlType02=true
config.xmlType03=true
config.xmlType03=true
3 changes: 1 addition & 2 deletions lcd4linux/src/data/default.lcd
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ config.WebIfDeny=
config.WebIfDesign=2
config.WetterApi=MSN
config.WetterApiKeyOpenWeatherMap=
config.WetterApiKeyWeatherUnlocked=
config.WetterCity=Berlin
config.Wetter2City=Berlin
config.WetterPath=
config.WetterLowColor=aquamarine
config.WetterHighColor=violet
config.WetterLowColor=aquamarine
config.WetterTransparenz=false
config.WetterIconZoom=40
config.WetterRain=true
Expand Down
2 changes: 1 addition & 1 deletion lcd4linux/src/data/default.vuduo2
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ config.WebIfDesign=2
config.WetterCity=London
config.Wetter2City=Berlin
config.WetterPath=
config.WetterLowColor=aquamarine
config.WetterHighColor=violet
config.WetterLowColor=aquamarine
config.WetterTransparenz=false
config.WetterIconZoom=40
config.WetterRain=true
Expand Down
3 changes: 0 additions & 3 deletions lcd4linux/src/dinobot/Makefile.am

This file was deleted.

Binary file removed lcd4linux/src/dinobot/dpflib.so
Binary file not shown.
Loading
Loading