Skip to content

Commit

Permalink
[script.xbmc.lcdproc] 4.1.0 (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
herrnst authored Dec 7, 2024
1 parent 172b4ee commit 95a60f1
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 374 deletions.
2 changes: 1 addition & 1 deletion script.xbmc.lcdproc/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions script.xbmc.lcdproc/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmc.lcdproc" name="XBMC LCDproc" version="4.0.0" provider-name="Team Kodi: Memphiz, Daniel 'herrnst' Scheller">
<addon id="script.xbmc.lcdproc" name="XBMC LCDproc" version="4.1.0" provider-name="Team Kodi: Memphiz, Daniel 'herrnst' Scheller">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
Expand All @@ -24,8 +24,10 @@
<assets>
<icon>resources/icon.png</icon>
</assets>
<news>4.0.0
- fix Python exception when using the HD44780 character encodings/translation maps
<news>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
</news>
</extension>
</addon>
4 changes: 4 additions & 0 deletions script.xbmc.lcdproc/changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
33 changes: 8 additions & 25 deletions script.xbmc.lcdproc/main.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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

Expand Down
29 changes: 8 additions & 21 deletions script.xbmc.lcdproc/resources/lib/charset_hd44780.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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 *
Expand Down
29 changes: 8 additions & 21 deletions script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a00.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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
Expand Down
29 changes: 8 additions & 21 deletions script.xbmc.lcdproc/resources/lib/charset_map_hd44780_a02.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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
Expand Down
33 changes: 8 additions & 25 deletions script.xbmc.lcdproc/resources/lib/common.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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

Expand Down
32 changes: 8 additions & 24 deletions script.xbmc.lcdproc/resources/lib/extraicons.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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

Expand Down
32 changes: 8 additions & 24 deletions script.xbmc.lcdproc/resources/lib/infolabels.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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
Expand Down
40 changes: 12 additions & 28 deletions script.xbmc.lcdproc/resources/lib/lcdbase.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
'''
# 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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)

Expand Down Expand Up @@ -491,7 +475,7 @@ def GetLCDMode(self):
return ret

def StripBBCode(self, strtext):
regexbbcode = "\[(?P<tagname>[0-9a-zA-Z_\-]+?)[0-9a-zA-Z_\- ]*?\](?P<content>.*?)\[\/(?P=tagname)\]"
regexbbcode = r"\[(?P<tagname>[0-9a-zA-Z_\-]+?)[0-9a-zA-Z_\- ]*?\](?P<content>.*?)\[\/(?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)
Expand All @@ -510,7 +494,7 @@ def StripBBCode(self, strtext):
while True:
loopcount = loopcount - 1
try:
mangledline, replacements = re.subn(self.m_reBBCode, "\g<content>", mangledline)
mangledline, replacements = re.subn(self.m_reBBCode, r"\g<content>", mangledline)
except:
return mangledline

Expand Down
Loading

0 comments on commit 95a60f1

Please sign in to comment.