Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#4600 closed enhancement (fixed)

update/proposal for python bindings

Reported by: trisooma Owned by: Anduin Withers
Priority: minor Milestone: 0.21
Component: contrib Version: head
Severity: low Keywords: python binding
Cc: Ticket locked: no

Description

I took the initial (to be) python bindings from trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV.py (xris), pulled it apart and put them in separate files. This is a proposal so this can serve as a base for creating the python bindings...

commnents plz

Attachments (8)

MythDB.py (4.6 KB) - added by trisooma 16 years ago.
Database component
python_bindings.tar.gz (5.1 KB) - added by trisooma 16 years ago.
TGZ version of files
mythtv_python_bindings.diff (18.5 KB) - added by Hadley Rich <hads@…> 16 years ago.
hads propsed patch to put python bindings in mythtv/
mythtv_python_bindings.2.diff (22.6 KB) - added by Hadley Rich <hads@…> 16 years ago.
version 2
mythtv_python_bindings.3.diff (19.6 KB) - added by trisooma <trisooma@…> 16 years ago.
version 3
mythtv_python_bindings.4.diff (19.6 KB) - added by Hadley Rich <hads@…> 16 years ago.
mythplugins.diff (449 bytes) - added by Hadley Rich <hads@…> 16 years ago.
mythtv_python_bindings.5.diff (23.5 KB) - added by Hadley Rich <hads@…> 16 years ago.

Download all attachments as: .zip

Change History (25)

Changed 16 years ago by trisooma

Attachment: MythDB.py added

Database component

Changed 16 years ago by trisooma

Attachment: python_bindings.tar.gz added

TGZ version of files

comment:1 Changed 16 years ago by trisooma <trisooma@…>

please ignore the MythDB.py file.. (couldn't remove it)

comment:2 Changed 16 years ago by xris

Owner: changed from Isaac Richards to xris
Status: newassigned

comment:3 Changed 16 years ago by Hadley Rich <hads@…>

Looks good to me, what's with all the extra whitespace though?

I've been meaning to do this for a while and propose they are moved into mythtv rather than mythplugins. I've got a couple of methods in my tree for storage groups and a bit of other extra stuff too. I'll open a ticket for them separately.

I can see some new command line options in MythDB.py and a new method getAllSettings, are there any other functional changes in there that I've missed?

I believe Anduin had some changes that he hadn't committed but that may be just for find_meta.py, I can't remember.

comment:4 Changed 16 years ago by xris

What about mythplugins? Language bindings live under mythtv/ in the source.

Changed 16 years ago by Hadley Rich <hads@…>

Attachment: mythtv_python_bindings.diff added

hads propsed patch to put python bindings in mythtv/

comment:5 Changed 16 years ago by Hadley Rich <hads@…>

I've just attached a patch including a simple setup.py to install the python bindings to the Python site-packages. I don't know enough about the build system to add it to configure etc. at this stage. I can look into it if need be.

Also in this patch I've renamed the module names to lower case to be in line with the Python standard library (well what they're aiming for at least). Any comments on this? I figured with a disruptive move like this now would be a good time to suggest it.

This patch also keeps the original whitespace from the current bindings.

Changed 16 years ago by Hadley Rich <hads@…>

version 2

comment:6 Changed 16 years ago by Hadley Rich <hads@…>

Just added an updated patch which includes changes to the build system to install the python bindings with make install.

I've just copied the build stuff from the perl bindings and updated the configure script etc. I don't really know the build system so if someone could check the changes for me that would be great.

It also includes changes to comments (only) in libs/libmythtv/programinfo.h to reflect the updated location of mythtv.py

Last difference is to import all the module globals into the mythtv namespace in init.py

Changed 16 years ago by trisooma <trisooma@…>

version 3

comment:7 Changed 16 years ago by trisooma <trisooma@…>

this patch is ONLY for the *.py files... dunno if the previous patches are affected by this. I thought that wasn't the case.

Comments added and renamed files. The devs using this package now have a friendlier interface, see interactive_mythtv.py for an example of how to use this package.

hads, can you confirm that my patch doesn't conflict with your patch?

comment:8 Changed 16 years ago by Hadley Rich <hads@…>

To be honest, I don't see the point of the last patch. The interface is not really different, you've just moved what I had in the main module to a separate file. I also don't like the renamed module names or classname, MythTV makes more sense than Base.

The description comments aren't standard docstring format and the other comments aren't really necessary or accurate, i.e. author, version and date.

Changed 16 years ago by Hadley Rich <hads@…>

Changed 16 years ago by Hadley Rich <hads@…>

Attachment: mythplugins.diff added

comment:9 Changed 16 years ago by Hadley Rich <hads@…>

I've just added mythtv_python_bindings.4.diff, this is based on mythtv_python_bindings.2.diff

The further changes are as follows;

  • Splits MythVideo? class into a separate module.
  • Adds module and class docstrings.
  • Removed some perl related stuff from python.pro that got copied over.
  • Adjusts PROTO_VERSION to 39 in line with the current MythTV.py in mythplugins.
  • Normalises case of module names to lower in logging instances etc.
  • Makes passing of arguments to MythDB optional.

If you'd like smaller split up versions of this diff then let me know.

I've also added a one liner diff for mythplugins which updates find_meta.py to use the lower case name. Tested as working here.

comment:10 Changed 16 years ago by Anduin Withers

Owner: changed from xris to Anduin Withers

comment:11 Changed 16 years ago by Anduin Withers

Owner: changed from Anduin Withers to xris

Umm, oops.

comment:12 Changed 16 years ago by Anduin Withers

Milestone: unknown0.21
Owner: changed from xris to Anduin Withers

Un-umm oops.

Changed 16 years ago by Hadley Rich <hads@…>

comment:13 Changed 16 years ago by Hadley Rich <hads@…>

Sorry, forgot to svn add the mythvideo.py module. mythtv_python_bindings.5.diff includes this.

comment:14 Changed 16 years ago by Anduin Withers

(In [15935]) Closes #3585 References #4600

Finishes off the cast info patch by adding the cast output to imdbpy.py.

Make minimal Python bindings available. Thanks to trisooma a xs4all nl and Hadley Rich for this.

comment:15 Changed 16 years ago by Anduin Withers

Resolution: fixed
Status: assignedclosed

Closed by [15948]

comment:16 Changed 16 years ago by Anduin Withers

(In [15975]) References #4600

Fix issues (spaces, wrong log level) that made it in accidentally.

comment:17 Changed 16 years ago by Anduin Withers

(In [15976]) References #4600

Merge in [15975] from trunk.

Original commit message:

Fix issues (spaces, wrong log level) that made it in accidentally.

Note: See TracTickets for help on using tickets.