diff --git a/script.xbmc.lcdproc/README.md b/script.xbmc.lcdproc/README.md index 69ae5af38..d2d142a19 100644 --- a/script.xbmc.lcdproc/README.md +++ b/script.xbmc.lcdproc/README.md @@ -1,7 +1,7 @@ Kodi (XBMC) LCDproc Python addon ================================= -Copyright (C) 2012-2018 Team Kodi, Daniel 'herrnst' Scheller +Copyright (C) 2012-2024 Team Kodi, Daniel 'herrnst' Scheller Based on initial work (C) 2012 Memphiz/Team Kodi (formerly Team XBMC) LCDproc support for Kodi implemented in Python, direct drop-in replacement for diff --git a/script.xbmc.lcdproc/addon.xml b/script.xbmc.lcdproc/addon.xml index e5884564a..12a21f2f2 100644 --- a/script.xbmc.lcdproc/addon.xml +++ b/script.xbmc.lcdproc/addon.xml @@ -1,5 +1,5 @@ - + @@ -24,8 +24,10 @@ resources/icon.png - 4.0.0 -- fix Python exception when using the HD44780 character encodings/translation maps + 4.1.0 +- Python 3.13 compat: Use raw strings for regex'es everywhere, fixes SyntaxError's (thanks alanswanson!) +- Python 3.13 compat: Replace long deprecated telnetlib usage with raw sockets (thanks m-wichmann!) +- Minor housekeepings diff --git a/script.xbmc.lcdproc/changelog.txt b/script.xbmc.lcdproc/changelog.txt index ee06f320e..30b4ab65b 100644 --- a/script.xbmc.lcdproc/changelog.txt +++ b/script.xbmc.lcdproc/changelog.txt @@ -1,3 +1,7 @@ +4.1.0 +- Python 3.13 compat: Use raw strings for regex'es everywhere, fixes SyntaxError's (thanks alanswanson!) +- Python 3.13 compat: Replace long deprecated telnetlib usage with raw sockets (thanks m-wichmann!) +- Minor housekeepings 4.0.0 - fix Python exception when using the HD44780 character encodings/translation maps 3.90.2 diff --git a/script.xbmc.lcdproc/main.py b/script.xbmc.lcdproc/main.py index 1b96eddaa..bae548028 100644 --- a/script.xbmc.lcdproc/main.py +++ b/script.xbmc.lcdproc/main.py @@ -1,28 +1,11 @@ -''' - XBMC LCDproc addon - - Addon entry point - - Copyright (C) 2012-2018 Team Kodi - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Addon entry point +# from resources.lib.xbmclcdproc import XBMCLCDproc diff --git a/script.xbmc.lcdproc/resources/lib/charset_hd44780.py b/script.xbmc.lcdproc/resources/lib/charset_hd44780.py index 91c686f7a..a81cd18d4 100644 --- a/script.xbmc.lcdproc/resources/lib/charset_hd44780.py +++ b/script.xbmc.lcdproc/resources/lib/charset_hd44780.py @@ -1,24 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# HD44780 charset codec +# import codecs from .charset_map_hd44780_a00 import * diff --git a/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a00.py b/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a00.py index e185c78d6..76b9afc85 100644 --- a/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a00.py +++ b/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a00.py @@ -1,24 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# HD44780-A00 char map +# encmap_hd44780_a00 = { 0x0000: 0x0000, # NULL diff --git a/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a02.py b/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a02.py index 92460f4d9..8886d8bc6 100644 --- a/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a02.py +++ b/script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a02.py @@ -1,24 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# HD44780-A02 char map +# encmap_hd44780_a02 = { 0x0000: 0x0000, # NULL diff --git a/script.xbmc.lcdproc/resources/lib/common.py b/script.xbmc.lcdproc/resources/lib/common.py index fb11efaf6..b96145afe 100644 --- a/script.xbmc.lcdproc/resources/lib/common.py +++ b/script.xbmc.lcdproc/resources/lib/common.py @@ -1,28 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - resources/lib/common.py: Common defines and functionality used throughout - the whole addon - Copyright (C) 2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Common defines and functionality used throughout the whole addon +# import os diff --git a/script.xbmc.lcdproc/resources/lib/extraicons.py b/script.xbmc.lcdproc/resources/lib/extraicons.py index 538efffa9..4584f9437 100644 --- a/script.xbmc.lcdproc/resources/lib/extraicons.py +++ b/script.xbmc.lcdproc/resources/lib/extraicons.py @@ -1,27 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - Extra icon defines/enums - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Extra icon defines/enums +# LCD_EXTRABARS_MAX = 4 diff --git a/script.xbmc.lcdproc/resources/lib/infolabels.py b/script.xbmc.lcdproc/resources/lib/infolabels.py index 4848974cf..ab113703b 100644 --- a/script.xbmc.lcdproc/resources/lib/infolabels.py +++ b/script.xbmc.lcdproc/resources/lib/infolabels.py @@ -1,27 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - InfoLabel handling - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# InfoLabel handling +# import sys import time diff --git a/script.xbmc.lcdproc/resources/lib/lcdbase.py b/script.xbmc.lcdproc/resources/lib/lcdbase.py index e11837cec..9b6157029 100644 --- a/script.xbmc.lcdproc/resources/lib/lcdbase.py +++ b/script.xbmc.lcdproc/resources/lib/lcdbase.py @@ -1,25 +1,9 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# import os import re @@ -382,7 +366,7 @@ def LoadMode(self, node, mode): return # regex to determine any of $INFO[LCD.Time(Wide)21-44] - timeregex = r'' + re.escape('$INFO[LCD.') + 'Time((Wide)?\d?\d?)' + re.escape(']') + timeregex = r'' + re.escape('$INFO[LCD.') + r'Time((Wide)?\d?\d?)' + re.escape(']') for line in node.findall("line"): # initialize line with empty descriptor @@ -430,7 +414,7 @@ def LoadMode(self, node, mode): elif linetext.lower().find("$info[lcd.playicon]") >= 0: linedescriptor['type'] = LCD_LINETYPE.LCD_LINETYPE_ICONTEXT linedescriptor['startx'] = int(1 + self.m_iIconTextOffset) # icon widgets take 2 chars, so shift text offset (default: 2) - linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.PlayIcon]") + '\s?', ' ', linetext, flags=re.IGNORECASE).strip() + linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.PlayIcon]") + r'\s?', ' ', linetext, flags=re.IGNORECASE).strip() # standard (scrolling) text line else: @@ -443,8 +427,8 @@ def LoadMode(self, node, mode): if linetext.lower().find("$info[lcd.alignright]") >= 0: linedescriptor['align'] = LCD_LINEALIGN.LCD_LINEALIGN_RIGHT - linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.AlignCenter]") + '\s?', ' ', linedescriptor['text'], flags=re.IGNORECASE).strip() - linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.AlignRight]") + '\s?', ' ', linedescriptor['text'], flags=re.IGNORECASE).strip() + linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.AlignCenter]") + r'\s?', ' ', linedescriptor['text'], flags=re.IGNORECASE).strip() + linedescriptor['text'] = re.sub(r'\s?' + re.escape("$INFO[LCD.AlignRight]") + r'\s?', ' ', linedescriptor['text'], flags=re.IGNORECASE).strip() self.m_lcdMode[mode].append(linedescriptor) @@ -491,7 +475,7 @@ def GetLCDMode(self): return ret def StripBBCode(self, strtext): - regexbbcode = "\[(?P[0-9a-zA-Z_\-]+?)[0-9a-zA-Z_\- ]*?\](?P.*?)\[\/(?P=tagname)\]" + regexbbcode = r"\[(?P[0-9a-zA-Z_\-]+?)[0-9a-zA-Z_\- ]*?\](?P.*?)\[\/(?P=tagname)\]" # precompile and remember regex to make sure re's caching won't cause accidential recompilation if not self.m_reBBCode: self.m_reBBCode = re.compile(regexbbcode) @@ -510,7 +494,7 @@ def StripBBCode(self, strtext): while True: loopcount = loopcount - 1 try: - mangledline, replacements = re.subn(self.m_reBBCode, "\g", mangledline) + mangledline, replacements = re.subn(self.m_reBBCode, r"\g", mangledline) except: return mangledline diff --git a/script.xbmc.lcdproc/resources/lib/lcdproc.py b/script.xbmc.lcdproc/resources/lib/lcdproc.py index 039d85f46..ca65f7210 100644 --- a/script.xbmc.lcdproc/resources/lib/lcdproc.py +++ b/script.xbmc.lcdproc/resources/lib/lcdproc.py @@ -1,28 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# import re -import telnetlib import time import xbmc @@ -48,8 +31,8 @@ def __init__(self, settings): self.m_lastInitAttempt = 0 self.m_initRetryInterval = INIT_RETRY_INTERVAL self.m_used = True - self.tn = telnetlib.Telnet() - self.tnsocket = None + self.m_socket = None + self.m_sockreadbuf = b'' self.m_timeLastSockAction = time.time() self.m_timeSocketIdleTimeout = 2 self.m_strLineText = [None]*MAX_ROWS @@ -66,6 +49,20 @@ def __init__(self, settings): LcdBase.__init__(self, settings) + def ReadUntil(self, separator): + if not self.m_socket: + return b"" + + while separator not in self.m_sockreadbuf: + data = self.m_socket.recv(1024) + if not data: + raise EOFError + self.m_sockreadbuf += data + + line, tmp, self.m_sockreadbuf = self.m_sockreadbuf.partition(separator) + + return line + def SendCommand(self, strCmd, bCheckRet): countcmds = strCmd.count(b'\n') sendcmd = strCmd @@ -77,12 +74,11 @@ def SendCommand(self, strCmd, bCheckRet): sendcmd += b"\n" try: - # Send to server via raw socket to prevent telnetlib tampering with - # certain chars (especially 0xFF -> telnet IAC) - self.tnsocket.sendall(sendcmd) - except: + # Send commands to LCDproc server + self.m_socket.sendall(sendcmd) + except Exception as ex: # Something bad happened, abort - log(LOGERROR, "SendCommand: Telnet exception - send") + log(LOGERROR, "SendCommand(): Caught %s on m_socket.sendall()" % type(ex)) return False # Update last socketaction timestamp @@ -94,10 +90,10 @@ def SendCommand(self, strCmd, bCheckRet): while True: try: # Read server reply - reply = self.tn.read_until(b"\n",3) - except: + reply = self.ReadUntil(b"\n") + except Exception as ex: # (Re)read failed, abort - log(LOGERROR, "SendCommand: Telnet exception - reread") + log(LOGERROR, "SendCommand(): Caught %s when reading back response(s)" % type(ex)) return False # Skip these messages @@ -116,10 +112,10 @@ def SendCommand(self, strCmd, bCheckRet): if not bCheckRet: continue # no return checking desired, so be fine - if strCmd == b'noop' and reply == b'noop complete\n': + if strCmd == b'noop' and reply == b'noop complete': continue # noop has special reply - if reply == b'success\n': + if reply == b'success': continue ret = False @@ -230,8 +226,8 @@ def DetermineExtraSupport(self): # Never cause script failure/interruption by this! This is totally optional! try: # Retrieve driver name for additional functionality - self.tn.write(b"info\n") - reply = self.tn.read_until(b"\n",3).strip().decode("ascii") + self.m_socket.send(b"info\n") + reply = self.ReadUntil(b"\n").strip().decode("ascii") # When the LCDd driver doesn't supply a valid string, inform and return if reply == "": @@ -271,16 +267,25 @@ def Connect(self): port = self.m_Settings.getHostPort() log(LOGDEBUG,"Open " + str(ip) + ":" + str(port)) - self.tn.open(ip, port) + self.m_socket = socket(AF_INET, SOCK_STREAM) + self.m_socket.settimeout(15) + self.m_socket.connect((ip, port)) + self.m_socket.settimeout(3) + + except Exception as ex: + log(LOGERROR, "Connect(): Caught %s on initial connect, aborting" % type(ex)) + return False + + try: # Start a new session - self.tn.write(b"hello\n") + self.m_socket.send(b"hello\n") # Receive LCDproc data to determine row and column information - reply = self.tn.read_until(b"\n",3).decode("ascii") + reply = self.ReadUntil(b"\n").decode("ascii") log(LOGDEBUG,"Reply: " + reply) # parse reply by regex - lcdinfo = re.match("^connect .+ protocol ([0-9\.]+) lcd wid (\d+) hgt (\d+) cellwid (\d+) cellhgt (\d+)$", reply) + lcdinfo = re.match(r"^connect .+ protocol ([0-9\.]+) lcd wid (\d+) hgt (\d+) cellwid (\d+) cellhgt (\d+)$", reply) # if regex didn't match, LCDproc is incompatible or something's odd if lcdinfo is None: @@ -314,14 +319,8 @@ def Connect(self): # (might override e.g. m_iBigDigits!) self.DetermineExtraSupport() - except: - log(LOGERROR,"Connect: Caught exception, aborting.") - return False - - # retrieve raw socket object - self.tnsocket = self.tn.get_socket() - if self.tnsocket is None: - log(LOGERROR, "Retrieval of socket object failed!") + except Exception as ex: + log(LOGERROR,"Connect(): Caught %s during hello/info phase, aborting." % type(ex)) return False if not self.SetupScreen(): @@ -331,7 +330,7 @@ def Connect(self): return True def CloseSocket(self): - if self.tnsocket: + if self.m_socket: # no pyexceptions, please, we're disconnecting anyway try: # if we served extra elements, (try to) reset them @@ -340,9 +339,9 @@ def CloseSocket(self): log(LOGERROR, "CloseSocket(): Cannot clear extra icons") # do gracefully disconnect (send directly as we won't get any response on this) - self.tn.write(b"bye\n") + self.m_socket.send(b"bye\n") # and close socket afterwards - self.tn.close() + self.m_socket.close() except: # exception caught on this, so what? :) pass @@ -351,12 +350,11 @@ def CloseSocket(self): del self.m_cExtraIcons self.m_cExtraIcons = None - self.tnsocket = None - del self.tn - self.tn = telnetlib.Telnet() + self.m_sockreadbuf = b'' + self.m_socket = None def IsConnected(self): - if not self.tnsocket: + if not self.m_socket: return False # Ping only every SocketIdleTimeout seconds @@ -370,7 +368,7 @@ def IsConnected(self): return True def SetBackLight(self, iLight): - if not self.tnsocket: + if not self.m_socket: return log(LOGDEBUG, "Switch Backlight to: " + str(iLight)) @@ -394,7 +392,7 @@ def Stop(self): self.m_bStop = True def Suspend(self): - if self.m_bStop or not self.tnsocket: + if self.m_bStop or not self.m_socket: return # Build command to suspend screen @@ -406,7 +404,7 @@ def Suspend(self): self.CloseSocket() def Resume(self): - if self.m_bStop or not self.tnsocket: + if self.m_bStop or not self.m_socket: return # Build command to resume screen @@ -531,7 +529,7 @@ def ClearLine(self, iLine): self.m_bstrSetLineCmds += b"widget_set xbmc lineScroller%i 1 %i %i %i m 1 \"\"\n" % (iLine, iLine, self.m_iColumns, iLine) def SetLine(self, mode, iLine, strLine, dictDescriptor, bForce): - if self.m_bStop or not self.tnsocket: + if self.m_bStop or not self.m_socket: return if iLine < 0 or iLine >= int(self.m_iRows): diff --git a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_base.py b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_base.py index 31c6fac97..8a834037f 100644 --- a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_base.py +++ b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_base.py @@ -1,27 +1,11 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - Stub class for extra symbol support e.g. on SoundGraph iMON or mdm166a LCDs/VFDs - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Stub class for extra symbol support e.g. on SoundGraph iMON or mdm166a LCDs/VFDs +# class LCDproc_extra_base(): def __init__(self): diff --git a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_imon.py b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_imon.py index 9db23ba13..4e7e648c5 100644 --- a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_imon.py +++ b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_imon.py @@ -1,28 +1,12 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - Support for extra symbols on SoundGraph iMON LCD displays - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - Original C implementation (C) 2010 Christian Leuschen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Support for extra symbols on SoundGraph iMON LCD displays +# Original C implementation (C) 2010 Christian Leuschen +# import time diff --git a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_mdm166a.py b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_mdm166a.py index d370e6225..4bfe22979 100644 --- a/script.xbmc.lcdproc/resources/lib/lcdproc_extra_mdm166a.py +++ b/script.xbmc.lcdproc/resources/lib/lcdproc_extra_mdm166a.py @@ -1,28 +1,12 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - - Support for extra symbols on Futaba/Targa USB mdm166a VFD displays - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - Original C implementation (C) 2010 Christian Leuschen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Support for extra symbols on Futaba/Targa USB mdm166a VFD displays +# Original C implementation (C) 2010 Christian Leuschen +# from .extraicons import * from .lcdproc_extra_base import * diff --git a/script.xbmc.lcdproc/resources/lib/settings.py b/script.xbmc.lcdproc/resources/lib/settings.py index d8fa2af69..c8f3e72c5 100644 --- a/script.xbmc.lcdproc/resources/lib/settings.py +++ b/script.xbmc.lcdproc/resources/lib/settings.py @@ -1,25 +1,9 @@ -''' - XBMC LCDproc addon - Copyright (C) 2012-2018 Team Kodi - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# import time diff --git a/script.xbmc.lcdproc/resources/lib/xbmclcdproc.py b/script.xbmc.lcdproc/resources/lib/xbmclcdproc.py index a16130a5e..84185ffff 100644 --- a/script.xbmc.lcdproc/resources/lib/xbmclcdproc.py +++ b/script.xbmc.lcdproc/resources/lib/xbmclcdproc.py @@ -1,28 +1,11 @@ -''' - XBMC LCDproc addon - - Main addon handler/control - - Copyright (C) 2012-2018 Team Kodi - Copyright (C) 2012-2018 Daniel 'herrnst' Scheller - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -''' +# SPDX-License-Identifier: GPL-2.0-or-later +# +# XBMC LCDproc addon +# Copyright (C) 2012-2024 Team Kodi +# Copyright (C) 2012-2024 Daniel 'herrnst' Scheller +# +# Main addon handler/control +# # base imports import time