Mailing List Archive

RfC: Easy to use interface for MythServices-API in Python3
Pull Request 198 and ticket #13620 extend the Python Bindings with an high
level interface to
the Services API.
See https://www.mythtv.org/wiki/Services_API .

All features outlined in the ticket are implemented.

Four usage, please see the commit message, the description in the source
code,
or the 'tutorial.py' attached at the ticket.

Get the pull request:
- git clone https://github.com/MythTV/mythtv.git mythtv
- git checkout master
- git fetch origin pull/198/head:mythservices
- git checkout mythservices

If you want to try this interface locally, put the folder of
'mythtv/bindings/python/MythTV' in an empty folder and copy the
'tutorial.py'
in front of that folder. Python will chose this folder to import MythTV.

Comments, suggestions and questions are welcome.
Please use this thread or add a comment to the pull request.

Roland
Re: RfC: Easy to use interface for MythServices-API in Python3 [ In reply to ]
On 5/22/20 9:09 AM, Roland Ernst wrote:
> Pull Request 198 and ticket #13620 extend the Python Bindings with an high
> level interface to
> the Services API.
> See https://www.mythtv.org/wiki/Services_API .
>
> All features outlined in the ticket are implemented.
>
> Four usage, please see the commit message, the description in the source
> code,
> or the 'tutorial.py' attached at the ticket.

...

> Comments, suggestions and questions are welcome.
> Please use this thread or add a comment to the pull request.

Roland,

Very interesting. Wondering of this could also be used to
replace the Wiki examples - but that's for another day.

Please comment on my tests attached. I'm missing the
way to print the response from things like GetHostName.

Thanks,

--
Bill
Re: RfC: Easy to use interface for MythServices-API in Python3 [ In reply to ]
On Sat, May 23, 2020 at 7:12 AM Bill Meek <keemllib@gmail.com> wrote:

> On 5/22/20 9:09 AM, Roland Ernst wrote:
> > Pull Request 198 and ticket #13620 extend the Python Bindings with an
> high
> > level interface to
> > the Services API.
> > See https://www.mythtv.org/wiki/Services_API .
> >
> > All features outlined in the ticket are implemented.
> >
> > Four usage, please see the commit message, the description in the source
> > code,
> > or the 'tutorial.py' attached at the ticket.
>
> ...
>
> > Comments, suggestions and questions are welcome.
> > Please use this thread or add a comment to the pull request.
>
> Roland,
>
> Very interesting. Wondering of this could also be used to
> replace the Wiki examples - but that's for another day.
>
> Please comment on my tests attached. I'm missing the
> way to print the response from things like GetHostName.
>
> Thanks,
>
> --
> Bill
>
>
Bill,
thank you for looking into this pull request.

It took some time to find the missing piece of that puzzle.
I updated the pull request and this update should now satisfy your tests.
Attached a modified version of 'mytest.py' which works for me.

I don't think that the new classes should replace the Wiki examples,
because they serve different uses cases:
- The wiki examples show how to create an application outside the Python
Bindings.
- The classes provided by 'mythservices.py' may help to perform complex
operations
like creating a capture card or adding channels with the Python
Bindings:
The method 'get_operation' lists all the data and types needed for such
an operation.
There is no need to analyse the 'wsdl' file manually.

But, maybe in the future, new examples can be alongside to the existing
examples
in the wiki ....

Regards,
Roland