Connecting to a DB
#46
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
Reply
#47
(2021-02-23, 11:21)vonson Wrote: 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
Happy to help but there were a few things which changed from Kodi 18 to Kodi 19 including Python.  The settings file and logging format changed too, as well as some of the Kodi functions.  There's a thread here on the changes.  I was looking around and couldn't find where I put a copy of your code.  One of the first things I would do is run the Python migration tool 2to3.py against your code.  It comes with Python 3 and does an excellent job of updating the Python 2 to 3 dependencies and changes.  If you can resend me your code I'll help.


Jeff
Reply
#48
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...
Reply
#49
(2021-02-23, 12:54)vonson Wrote: 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...

I got your files and responded back.  The first thing to do is fix the addon.xml file for the Python 3.0.0.0 dependency.  That's likely why you are getting the incompatibility error.  2to3.py comes with any Python 3 installation and will fix the subsequent Python errors which will occur next.


Jeff
Reply
#50
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.
Reply
#51
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
Reply
#52
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.
Reply
#53
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
Reply



Logout Mark Read Team Forum Stats Members Help
Connecting to a DB0
This forum uses Lukasz Tkacz MyBB addons.