Changes to the python API for Kodi Krypton

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #1
Below you'll find an up-to-date list of all changes made to the python API since the release of Kodi Jarvis.



Please keep this thread clean. It should be an easy overview for python coders who are updating their addon for Kodi Krypton.
For discussions / feature requests / bugreports, please find (or create) the appropriate thread in the addon development forum.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-01-02 15:39 by ronie.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #2
2015-12-05 python 2.7.10 available on all platforms

the python version shipped with kodi has been updated to 2.7.10.

if your addons contains specific code to make it run under python 2.6,
you can now safely remove that code.


pull request: https://github.com/xbmc/xbmc/pull/8207

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #3
2015-12-05 script.module.simplejon - no longer needed

as a result of the bump to python 2.7.10, the use of simplejon is no longer needed/recommended.
python 2.7.x contains a json module which is much faster than simplejson, so use that one instead

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2015-12-06 21:11 by ronie.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #4
2015-12-05 PIL replaced with Pillow

we've replaced the PIL module shipped with Kodi with Pillow.
Pillow is fully backward compatible* with PIL, so this change should not cause any issues in your addon.
the script module will still be called script.module.pil

* the only differences are related to supported import methods
  • Pillow does not support 'import Image'. please use 'from PIL import Image' instead.
  • Pillow does not support 'import _imaging'. please use 'from PIL.Image import core as _imaging' instead.


pull request: https://github.com/xbmc/xbmc/pull/8207

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-07-17 18:23 by ronie.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #5
2015-12-06 xbmc.log() - default loglevel changed to xbmc.LOGDEBUG

to prevent the kodi.log from being spammed by addon logging,
we've changed the default loglevel for addons to DEBUG.

please do not use any other loglevels in addons you release to the public.
also, don't use 'print' statements in your addon as they will spam the regular log as well, always use xbmc.log() instead.
(print has been changed to logdebug level as well: https://github.com/xbmc/xbmc/pull/8316)


pull request: https://github.com/xbmc/xbmc/pull/8444

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2015-12-20 01:09 by ronie.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #6
2015-12-09 xbmcvfs.exists() - no caching

up 'till now xbmcvfs.exists(dir) would cache the result of the first check and return the result on subsequent checks.
this has been disabled now, as it could cause issues in addons.
see: http://forum.kodi.tv/showthread.php?tid=...pid1899282


pull request: https://github.com/xbmc/xbmc/pull/8531

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #7
2015-12-19 xbmc.RenderCapture() - changes

we've made the following changes to methods in the RenderCapture() class:


xbmc.RenderCapture().capture()
- removed the option to pass 'flags'

xbmc.RenderCapture().getCaptureState()
- this method has been removed

xbmc.RenderCapture().getImageFormat()
- image will now always be returned in BGRA

xbmc.RenderCapture().getImage()
- added the option to specify wait time in msec.

xbmc.RenderCapture().waitForCaptureStateChangeEvent()
- this method has been removed


pull request: https://github.com/xbmc/xbmc/pull/8613

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-06-27 21:51 by ronie.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #8
2015-12-27 python api bump

our python api has been bumped to 2.25.0

please keep the version your addon depends upon up to date!
(many addons still depend on 2.1.0, those will break once we remove backward compatibility to the 2.1.0 api)

Code:
2.14.0  -  Gotham 13.x
2.19.0  -  Helix 14.x
2.20.0  -  Isengard 15.x
2.24.0  -  Jarvis 16.x
2.25.0  -  K*** 17.x


pull request: https://github.com/xbmc/xbmc/pull/8505

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #9
2015-12-29 xbmc.Player() - changes

it is no longer possible to specify a PLAYER_CORE in the xbmc.Player class.
you'll have to use xbmc.Player() and kodi will auto-select the appropriate player.


pull request: https://github.com/xbmc/xbmc/pull/8525

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,687
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #10
2015-02-15 Content type changes

Bit late, but also probably worth mentioning here.
Image addons should set content type to "images" in case the list you´re displaying contains pictures.

git commit: https://github.com/xbmc/xbmc/commit/3843...33220c148c
pull request: https://github.com/xbmc/xbmc/pull/8679

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #11
2015-12-15 DialogSelect.xml - cancel button

in case your addon uses the WindowXMLDialog class to load DialogSettings.xml:
Code:
w = MainGui("DialogSelect.xml", CWD, listing=my_list)
w.doModal()

please note a new cancel button (id="7") has been added to this xml file.
your addon needs to control the visibility of this button, set the label and process the onclick of this button.


the above does *not* apply if you access the select dialog through the builtin xbmc.Dialog().select() method.

pull request: https://github.com/xbmc/xbmc/pull/8417

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #12
2015-02-26 WindowXML - container properties

the method to set container properties, setProperty(), in the WindowXML class has been renamed to:
setContainerProperty()

That way WindowXML.setProperty() now behaves the same as Window.SetProperty().

pull request: https://github.com/xbmc/xbmc/pull/9187

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-02-26 17:22 by phil65.)
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #13
2015-02-26 New clothes for Kodi

in case your script includes a script window / dialog
and you've made it to match the look of Confluence,
please know that we now have a new default skin: Estuary.

you may to to update your script windows to match the look of Estuary.


pull request: https://github.com/xbmc/xbmc/pull/9235

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,687
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #14
2015-03-06 New methods for InfoTagVideo

added some new methods for xbmc.InfoTagVideo:

xbmc.InfoTagVideo.getTVShowTitle()
xbmc.InfoTagVideo.getMediaType()
xbmc.InfoTagVideo.getSeason()
xbmc.InfoTagVideo.getEpisode()


pull request: https://github.com/xbmc/xbmc/pull/9267

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
find quote
ronie Online
Team-Kodi Member
Posts: 13,168
Joined: Jan 2009
Reputation: 392
Post: #15
2015-04-08 Additional infolabels

addons can now also set the following infolabels though the ListItem().setInfo() method:
  • imdbnumber : string (tt0110293) - IMDb code
  • set : string (Batman Collection) - name of the collection
  • setid : integer (14) - ID of the collection



pull request: https://github.com/xbmc/xbmc/pull/9570

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply