Posts: 41
Joined: Nov 2019
Reputation:
0
vonson
Junior Member
Posts: 41
Hey,
I hope you can help me again: After upgrading to 19 my plugin is no longer 'compatible' ...?... I guess this is because of the change to Python 3 ? Is there a quick fix to get it working again?
Best wishes,
Marc
Posts: 41
Joined: Nov 2019
Reputation:
0
vonson
Junior Member
Posts: 41
Hi,
thanks for answering so quickly.
I'll have to check how this 2to3.py works, even where to find it...
As for my files - I did send them via email (to the adress that you gave me in december), I do not know if attaching files in the forum is even possible... Let's see if this works, My Emails were blocked back then...
Posts: 41
Joined: Nov 2019
Reputation:
0
vonson
Junior Member
Posts: 41
OK,
I modified the addon.xml as described.
Then I had 2to3.py modify my addon.py file. At first it did not work because I have some german special characters in there that were not prperly formated; after correcting these I could run 2to3 on the file. Actually I had to run it twice, on the second run it still did some changes.
Now it does not change the file any more, but it still tells me that it needs to be modified:
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No changes to D:\Work\Kodi\script.atumno.videoarchiv\addon.py
RefactoringTool: Files that need to be modified:
RefactoringTool: D:\Work\Kodi\script.atumno.videoarchiv\addon.py
And in Kodi I still get a 'not compatible' error when trying to activate the plugin.
I will mail you the modified files via Email.
Posts: 127
Joined: Oct 2015
Reputation:
0
2021-02-23, 17:12
(This post was last modified: 2021-02-23, 17:24 by jbinkley60. Edited 1 time in total.)
So my error here. I added an extra .0 in the Python dependency like in your addon.xml file.
It should be:
<import addon="xbmc.python" version="3.0.0"/>
and not:
<import addon="xbmc.python" version="3.0.0.0"/>
With this change it now loads under Kodi 19.
Jeff
Posts: 41
Joined: Nov 2019
Reputation:
0
vonson
Junior Member
Posts: 41
2021-02-23, 19:36
(This post was last modified: 2021-02-23, 19:53 by vonson. Edited 3 times in total.)
If somebody does something similar in his own addon and is interested in how to solve my little problem:
First of all, keep in mind, you'll need to keep 2 separate versions of your addon for Kodi 18 and Kodi 19.
Then, the changes I had to do (for the Kodi 19 version):
In the 'addon.xml' file I had to change
<import addon="xbmc.python" version="2.14.0"/>
to
<import addon="xbmc.python" version="3.0.0"/>
Now you need to run 2to3.py. If you have Python installed, you will find it in there.
On the command line run:
[PathToPython]\Tools\scripts\2to3.py [PathToAddon]\addon.py
This gives you a list of the changes it will have to do.
With the switch -w the changes will be written. So run:
[PathToPython]\Tools\scripts\2to3.py -w [PathToAddon]\addon.py
Even if successful try again. Mine found more changes to be made on the second run, so I'd recommend to try this.
With this the plugin could be activated in Kodi 19, but when opening it I still ran into an error
Error Type: <class 'TypeError'>
Error Contents: 'iconImage' is an invalid keyword argument for this function
So I had to change the lines
li = xbmcgui.ListItem(title, iconImage=image)
li.setArt({'thumb': image, 'poster': image})
to
li = xbmcgui.ListItem(title)
li.setArt({'banner': image, 'poster': image, 'icon': image})
This fixed it.
Maybe somebody else may find this useful.
Posts: 127
Joined: Oct 2015
Reputation:
0
Thanks for the update and info. I am glad we were able to get your addon ported to Kodi and you back up and running.
Jeff