[mythtv-commits] Ticket #13565: Fix recorded markup handling in python3 bindings
MythTV
noreply at mythtv.org
Tue Jan 21 20:11:50 UTC 2020
#13565: Fix recorded markup handling in python3 bindings
-----------------------------------+--------------------------
Reporter: rcrdnalor | Owner: Bill Meek
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Bindings - Python | Version: Master Head
Severity: medium | Keywords: python3
Ticket locked: 0 |
-----------------------------------+--------------------------
With python3, the following methods of the Python Bindings
return now a generator, in opposite to python2,
where they return a list:
{{{
Recorded.markup.getskiplist()
Recorded.markup.getunskiplist()
Recorded.markup.getcutlist()
Recorded.markup.getuncutlist()
}}}
This will break almost all home-made transcoding scripts,
once called with python3. Found during debugging of #13562.
Luckily, this is easy to fix, patch attached.
It works for python2 and python3 as well.
Without the patch:
{{{
$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
>>> from MythTV import MythDB, Recorded
>>> db = MythDB()
>>> rec = Recorded((3002,20200120201100), db = db)
>>> rec.markup.getcutlist()
<zip object at 0x7f63ee572d88> <--- this is the generator
>>> list(rec.markup.getcutlist())
[(0, 13204), (159325, 9999999)]
>>>
}}}
With patch:
{{{
$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
>>> from MythTV import MythDB, Recorded
>>> db = MythDB()
>>> rec = Recorded((3002,20200120201100), db = db)
>>> rec.markup.getcutlist()
[(0, 13204), (159325, 9999999)]
>>>
}}}
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13565>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list