Eden API changes

From XBMC
(Difference between revisions)
Jump to: navigation, search
(See also)
Line 192: Line 192:
 
== See also ==
 
== See also ==
 
* [[JSON-RPC_API/v3|JSON-RPC API v3 (pre Eden)]]
 
* [[JSON-RPC_API/v3|JSON-RPC API v3 (pre Eden)]]
 +
* [[Frodo API changes]]
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 21:03, 1 May 2012

Eden will represent the first repository update, and as a result we have taken the opportunity to change the API for several subsystems. Any add-ons that are submitted for inclusion in Eden-pre and Eden will require compatibility with the new APIs.

The Eden-pre repository will be created soon, while the APIs may still change somewhat. When the APIs are frozen, the final Eden repository will open and final API compatibility will be enforced.

Be sure to read the Official Repository Guidlines before submitting a pull request.

Contents

1 Scripts and Plugins

XBMC now uses an external version of Python rather than a self-built one. This brings many benefits but means that some plugins/scripts will have to change slightly. In order to be considered for inclusion in the Eden repository, the following must be true.

try:
    from sqlite3 import dbapi2 as sqlite
    logFile.info("Loading sqlite3 as DB engine")
except:
    from pysqlite2 import dbapi2 as sqlite
    logFile.info("Loading pysqlite2 as DB engine")

1.1 Backwards Compatibility

If your add-on depends on xbmc.python version 1.0 or less, backwards-compatibly mode is enabled (note: as it says above, if this is the case it will not be accepted into the eden repository). This was done in an effort to try to keep out-of-date addons working.

Certain deprecated functions like os.getcwd() will produce a warning in backwards-compatibility mode, whereas they will fail outright otherwise. Add-ons with this enabled will not be accepted into the Eden repo, they should instead be updated.

2 Skins

For now, see the discussion on the forum. Docs coming soon.

3 JSON-RPC

This interface has been almost entirely redone for Eden, and is still a work in progress. This means that there won't be any backwards compatibility to the JSON-RPC API provided in Dharma (10.0).

3.1 General changes (Implementation)

The whole implementation of the JSON-RPC server has been refactored to be compliant with the JSON-RPC 2.0 specification. These changes involve:

3.1.1 Error responses

If a client sends a JSON-RPC request which does not match the JSON schema description defined by JSONRPC.Introspect, the data object of the response will contain a detailed error description defined by the following JSON schema:

{
  "type": "object",
  "properties": {
    "method": { "type": "string "required": true },
    "message": { "type": "string" },
    "stack": { "type": "object",
      "id": "stackentry",
      "properties": {
        "name": { "type": "string", "required": true },
        "type": { "type": "string", "required": true },
        "message": { "type": "string" },
        "property": { "$ref": "stackentry" }
      }
    }
  }
}

3.2 API changes

For migration guidance, see the discussion on the forum.

3.2.1 Namespace changes

3.2.2 Changed methods

3.2.3 New methods

4 Scrapers

No major API changes at this time.

5 Screensavers and visualizations

These methods now have a ADDON_ prefix to avoid global namespace clashes

6 See also

Personal tools
Namespaces
Variants
Actions
Navigation
Wiki help
Google Search
Toolbox