0.25 Python Bindings/Upgrade Guide

From MythTV Official Wiki
Jump to: navigation, search

This page outlines the new requirements and changes for the Python bindings in MythTV 0.25, and serves as a guide to what updates are needed for scripts and programs built using them.

Python 2.5

In this version, support for Python 2.5 is officially dropped. Python 2.6 and 2.7 are the only supported versions, due to new control structures and utilities added. Python 2.7 requires that MySQLdb version 1.2.3 be installed.

exportMetadata

This method has been added to both the Recorded and Video classes, and is an initial attempt at supporting XML metadata along side video files. This method exports a metadata object identical to that imported by importMetadata, using the stored information in the database.

MythVideo

The MythVideo class and all of its special methods have been migrated into the MythDB class. scanStorageGroups() has been replaced by a scanVideos(), which returns three lists of added, moved, and deleted videos. The MythVideo class remains, but it is just a shell around MythDB, and will be removed in a future version. scanStorageGroups() behaves as before, however the backend will always delete missing content. The option given by the method does nothing.

MythDB

The legacy methods getRecorded() and getChannels() have been removed. Use MythDB.searchRecordings() and Channel.getAllEntries() respectively.

Frontend

The getJump(), sendJump(), getKey(), and sendKey() methods have been removed. Use the jump and key meta-objects.

Grabber

The grabTitle() method has been removed. Use search() instead.

MythXML

MythTV's XML interface has been rewritten for 0.25, and many of the methods in this class have been altered to follow suit. The previous _query(), _queryObject(), and _queryTree() methods have been removed in favor of a single _request() method. This returns a Request object, with the methods open(), read(), readEtree(), and readJSON(). The _request() method takes the same inputs as the old interface.

BEConnection/BECache

These classes have been greatly simplified. Outbound queries and inbound events are now handled in independent connections. BECache is now used to manage both connections, rather than just queries. BEEvent remains, but is a shell around BECache, and will be removed in a future version. The BECache class now only accepts standard events. Access to system events is only available by using the lower level BEEventConnection class directly.