2024-03-27, 19:29
I created the SportsView addon (WIP).
When i run it on my windows machine and / or Android (Nvidia Shield) it works fine. But when a user is trying to use it on a Linux machine they are getting this error:
error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'IndexError'> Error Contents: list index out of range Traceback (most recent call last): File "/home/alarm/.kodi/addons/plugin.sportsview/mysports/mysportswindow.py", line 44, in onAction self.sports_buttons.moveFocus(1, 0) File "/home/alarm/.kodi/addons/plugin.sportsview/mysports/mysportsbuttons.py", line 231, in moveFocus self.parent_window.setFocusId(self.buttons[self.focused_index].getId()) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ IndexError: list index out of range -->End of Python script error report<--
I realize textsize is apparently deprecated. However, when i attempt to use textlength I get this error:
2024-03-27 12:50:02.704 T:28592 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'ImageDraw' object has no attribute 'textlength'
Traceback (most recent call last):
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportswindow.py", line 23, in onInit
self.sports_buttons.get_sports_folders()
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 80, in get_sports_folders
self.check_button_cache()
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 103, in check_button_cache
self.generate_custom_buttons(sport)
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 128, in generate_custom_buttons
text_width, text_height = focused_draw.textlength(sport, font)
AttributeError: 'ImageDraw' object has no attribute 'textlength'
-->End of Python script error report<--
All machines have PIL 10.2 installed.
The addon.xml import line for pil is this : <import addon="script.module.pil" version="1.1.7"/>
Feels like a damned if i do damned if i don't situation at the moment. I don't have Linux to test on but i don't think Linux is the issue here.
Appreciate any insights!! THanks!!
When i run it on my windows machine and / or Android (Nvidia Shield) it works fine. But when a user is trying to use it on a Linux machine they are getting this error:
error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'IndexError'> Error Contents: list index out of range Traceback (most recent call last): File "/home/alarm/.kodi/addons/plugin.sportsview/mysports/mysportswindow.py", line 44, in onAction self.sports_buttons.moveFocus(1, 0) File "/home/alarm/.kodi/addons/plugin.sportsview/mysports/mysportsbuttons.py", line 231, in moveFocus self.parent_window.setFocusId(self.buttons[self.focused_index].getId()) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ IndexError: list index out of range -->End of Python script error report<--
I realize textsize is apparently deprecated. However, when i attempt to use textlength I get this error:
2024-03-27 12:50:02.704 T:28592 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'ImageDraw' object has no attribute 'textlength'
Traceback (most recent call last):
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportswindow.py", line 23, in onInit
self.sports_buttons.get_sports_folders()
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 80, in get_sports_folders
self.check_button_cache()
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 103, in check_button_cache
self.generate_custom_buttons(sport)
File "C:\Users\mjc_c\AppData\Roaming\Kodi\addons\plugin.sportsview\mysports\mysportsbuttons.py", line 128, in generate_custom_buttons
text_width, text_height = focused_draw.textlength(sport, font)
AttributeError: 'ImageDraw' object has no attribute 'textlength'
-->End of Python script error report<--
All machines have PIL 10.2 installed.
The addon.xml import line for pil is this : <import addon="script.module.pil" version="1.1.7"/>
Feels like a damned if i do damned if i don't situation at the moment. I don't have Linux to test on but i don't think Linux is the issue here.
Appreciate any insights!! THanks!!