Opened 14 years ago
Closed 14 years ago
#7264 closed task (fixed)
Rewrite of Python Bindings
Reported by: | Owned by: | Raymond Wagner | |
---|---|---|---|
Priority: | minor | Milestone: | 0.23 |
Component: | Bindings - Python | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
This is a rewrite of the python bindings scheduled for 0.23 in an attempt to clean up the interface, from the existing motley assortment of functions.
Attachments (14)
Change History (26)
Changed 14 years ago by
Attachment: | rewrite.demo.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite.demo2.tar.bz2 added |
---|
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | rewrite.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite2.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite3.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite4.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite5.tar.bz2 added |
---|
comment:2 Changed 14 years ago by
Quick note for whenever this gets committed, update mythtv/libs/libmythdb/mythversion.h to reference mythtv/bindings/python/MythTV/MythStatic.py as the only file that needs updating for proto/schema bumps.
Changed 14 years ago by
Attachment: | rewrite6.tar.bz2 added |
---|
comment:3 Changed 14 years ago by
6 includes:
Main schema bump
Lots of database, socket, and network logging
Addition of MythVideo? wrapper functions from -dev list
Alterations to repr values (purely superficial)
Changed 14 years ago by
Attachment: | rewrite7.tar.bz2 added |
---|
comment:4 Changed 14 years ago by
7 includes:
Assorted fixes.
'logfile' argument to MythLog? class. After this is used, all existing and subsequent instances will log to this file.
'from MythTV import *' now behaves properly, returning all usable objects, rather than the four base files.
Calling 'init.py' from the terminal now opens an interactive session, expanding on the previous behavior of 'MythTV.py.'
Changed 14 years ago by
Attachment: | rewrite8.tar.bz2 added |
---|
Changed 14 years ago by
Attachment: | rewrite9.tar.bz2 added |
---|
comment:5 Changed 14 years ago by
*added MythTV subclass for MythBE (for backwards compatibility)
*added MythDB.searchJobs and MythDB.searchGuide
*other assorted fixes
comment:6 Changed 14 years ago by
Owner: | changed from Anduin Withers to Raymond Wagner |
---|---|
Status: | new → assigned |
Changed 14 years ago by
Attachment: | rewrite10.tar.bz2 added |
---|
comment:7 Changed 14 years ago by
- fixes issues with MythBE() functions and UTF-8 characters in Progam() data.
- fixes MythLog?() for Python 0.25.
- adds MythBE.walkSG to behave similarly to os.walk, providing a tuple of (path, directories, files)
Changed 14 years ago by
Attachment: | rewrite11.tar.bz2 added |
---|
comment:8 Changed 14 years ago by
- MythError? fixed to print proper error string on traceback
- MythError? tweaked to provide error codes, and additional information
- MythBE subclassed to FileOps?, and now includes the functions of the latter
- MythVideo?.pruneMetadata rewritten to MythVideo?.scanStorageGroups. Now optionally returns a tuple of new files in the form (hostname, path, hash), and a tuple of no longer available Video objects.
comment:9 Changed 14 years ago by
Please change python.pro such that you follow the --prefix directive of the primary configure. You force the bindings into /usr/local
Changed 14 years ago by
Attachment: | jamu_mirobridge_mnv_grabber_patches.tar.gz added |
---|
Jamu, Mirobridge and MythNetvision?-grabber python bindings patches
comment:10 Changed 14 years ago by
Jamu, Miro Bridge and Myth Netvision-grabber patches implementing the new python bindings.
Please do not apply them until wagnerrp approves as the patches were developed/tested with a later version of the python bindings then are currently posted on this ticket (later than rewrite11.tar.bz2).
comment:11 Changed 14 years ago by
(In [23287]) Initial commit of updated Python bindings. refs #7264
The rewrite was based around object mapping of several data structures and database tables into a structure more readily usable in Python. Also included are:
Rewrite of database access:
Credentials can now be more easily specified while opening the connection. Additionally, these credentials can easily be carried through to all functions and classes that may use the database, allowing proper use of alternate credentials from those found in the config.xml. A basic UPNP implementation now allows the bindings to search for available backends on the network, defaulting to a PIN of 0000, and creating a config.xml upon receipt of credentials. The database object now implements connection caching, so one set of credentials will only open one connection to the database.
Rewrite of backend access:
The backend socket now also implements caching, reusing connections wherever possible.
Logging rewrite:
The previous logging interface is replaced with one using bitwise filtering similar to that found in the MythTV binaries. Verbosity level follows the same rules, and defaults to 'important,general'.
Exceptions rewrite:
Errors continue to function as before, however several attributes have been added to allow for additional filtering and handling.
Grabber interface:
A basic class for retrieving data from external commands is now available, with customized forms for the MythVideo? and MythNetVision? grabber formats.
Canned searches:
Several keyword-based searches are now available for recordings, oldrecordings, jobs, guide data, and videos.
comment:12 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
A month after commit with no activity, I'm going to close this. Any future bugs can open new tickets.
Above is an example of the direction I intend the rewrite to take. The new bindings will make extensive use of subclassing, starting with the 'ListData?' class. The class is intended to take a list of data, and store it against a pre-defined list of field names. The resulting object can be used as a regular object with variables, or as a dictionary or list, depending on which the user feels makes most sense.
Building off of these are DBData, and DBDataWrite, which are intended to make an easily accessible object for reading data from the database, and to allow writing data back and creating new entries, respectively.
The Video object is the first major rewrite using this, moving most of the functionality out of the old MythVideo? class, leaving only search functions and general management.
It should be understood that 0.23 is expected to include a internal rewrite, and partial merging of recordings and videos. As such, the posted demo should be taken as the direction I intend to go with the rewrite, rather than any indication of what the final product will look like.