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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#54
Hey Jeff,

are you still around? It's been a year now and the addon stopped working.
Quick reminder: I'm accessing a csv File to generate a movie list from it.

When I run the addon from a windows machine it works, but on my fire stick it doesn't, it just displays an empty result.
I'd expect a file/folder permission issue, but i just experimentally granted full read/write permissions to everyone, and it still won't work...

Do you have any idea?
Reply
#55
(2022-02-11, 11:53)vonson Wrote: Hey Jeff

Not sure if @jbinkley60 reads all the forum posts, but using his first name only is not always enough. Pinging his forum name like this works better.
Reply
#56
(2022-02-11, 11:53)vonson Wrote: Hey Jeff,

are you still around? It's been a year now and the addon stopped working.
Quick reminder: I'm accessing a csv File to generate a movie list from it.

When I run the addon from a windows machine it works, but on my fire stick it doesn't, it just displays an empty result.
I'd expect a file/folder permission issue, but i just experimentally granted full read/write permissions to everyone, and it still won't work...

Do you have any idea?


I suspect it is more of a file path issue due to the different locations files are stored across platforms.  You might look at this link and see if it helps.  Kodi has the xbmcvfs functions to help with path translation, ensuring a file exists etc. 

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#57
(2022-02-11, 12:18)Klojum Wrote:
(2022-02-11, 11:53)vonson Wrote: Hey Jeff

Not sure if @jbinkley60 reads all the forum posts, but using his first name only is not always enough. Pinging his forum name like this works better.

Indeed it does.  Thanks.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#58
Thanks for all the replies. So far I could not resolve anything, but still thanks everyone.

Strangely, on my android tablet it still works, it's only on the firestick that it stopped working...
Reply
#59
(2022-02-13, 16:16)vonson Wrote: Thanks for all the replies. So far I could not resolve anything, but still thanks everyone.

Strangely, on my android tablet it still works, it's only on the firestick that it stopped working...

Was the Firestick working and it stopped or did it ever work ?  Maybe you can post your code which is opening the file so we can see what youa re doing ?


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#60
yes, it did work on the firestick, but i did not use it for some time, and now it doesn't anymore...
and it is still the same unchanged code from one year ago.


I believe this is the section that reads the file: 

separator = "\\"
if CsvFile.find(separator) > 0:
    folder = left(CsvFile,CsvFile.rfind(separator))
else:
    separator = "/"
    if CsvFile.find(separator) > 0:
        folder = left(CsvFile,CsvFile.rfind(separator))

read_obj = xbmcvfs.File (CsvFile.encode("utf-8"), 'r')
read_obj = read_obj.read()
csv_reader = csv.reader(read_obj, delimiter='|', skipinitialspace=True)
Reply

Logout Mark Read Team Forum Stats Members Help
Connecting to a DB0