LinHES Forums
http://forums.linhes.org/

Need Python Help For MythTV Programming
http://forums.linhes.org/viewtopic.php?f=21&t=24690
Page 1 of 1

Author:  sparks [ Tue Oct 24, 2017 10:23 am ]
Post subject:  Need Python Help For MythTV Programming

I am having a problem working with a python program I found in the pages of the MythTV wiki. Python isn't really one of mine but usually have been able to muddle through other programs since I am familiar wth the basic core language and can usually work something out. However, this program uses MythTV bindings/APIs/something and I don't know where to find documentation. Probably mostly because I don't know exactly what I'm looking for.The line that is giving me grief is:

Code:
db = MythDB()
~~~~~~~~~~~~~~~~~~~~~~ <====somecode

rec = Recorded((chanid, utcstarttime), db=db);

I think the function (my word) is introduced by the line near the beginning of the program:
Code:
from MythTV import Job, Recorded, System, MythDB, findfile, MythError, MythLog, datetime

The program is transcode-h264-v2.py found in the MyhTV wiki. The error I get is:

Code:
chanid "2279"
utcstarttime "2017-10-22 00:00:00-05:00"
starttime "20171022000000"
tzoffset "0"
Traceback (most recent call last): :oops:
  File "./transcode-h264-v2.py", line 686, in <module>
    main()
  File "./transcode-h264-v2.py", line 680, in main
    runjob(chanid=opts.chanid, starttime=opts.starttime, tzoffset=opts.tzoffset)
  File "./transcode-h264-v2.py", line 177, in runjob
    rec = Recorded((chanid, utcstarttime), db=db);
  File "/usr/lib/python2.7/site-packages/MythTV/dataheap.py", line 342, in __init__
    DBDataWrite.__init__(self, data, db)
  File "/usr/lib/python2.7/site-packages/MythTV/database.py", line 318, in __init__
    DBData.__init__(self, data, db)
  File "/usr/lib/python2.7/site-packages/MythTV/database.py", line 180, in __init__
    self._pull()
  File "/usr/lib/python2.7/site-packages/MythTV/database.py", line 388, in _pull
    DBData._pull(self)
  File "/usr/lib/python2.7/site-packages/MythTV/database.py", line 204, in _pull
    raise MythError('DBData() could not read from database')
MythTV.exceptions.MythError: DBData() could not read from database

I need someone to tell me what I am dealing with 'from MythTV import' and where the dox are. I would like to troubleshoot this myself but find I am in way over my head at the moment so I am looking for a helping hand to reach down and pull my head above the water.


sparks :oops: :?

Author:  alien [ Wed Oct 25, 2017 2:47 am ]
Post subject:  Re: Need Python Help For MythTV Programming

From the error, my guess would be that it isn't authenticating with the database correctly.

Have you tried running this under the same userID as the backend? If that didn't work, then I would check all the Config.xml files. There may be several on your system... They should all have correct DB userID/password. See https://www.mythtv.org/wiki/Config.xml for the various locations.

Cheers,

Allen

Author:  sparks [ Wed Oct 25, 2017 3:47 pm ]
Post subject:  Re: Need Python Help For MythTV Programming

Thanks for the reply. I checked my config.xml files and they all have proper credentials in them. One google hit suggested that it means no rows were selected. The debug print of the date/time has that UTC differential on the end. I keep thinking that it might be what is causing a problem.

I am really looking for the documentation on how to use the routine (function call 'Recorded'). Am I using a 'binding' or an 'API' or something else? None of the MythTV documentation I have looked at seems to look familiar with regards to this usage or document any explanation. There seems to be a lot that goes unstated for the novice.

s

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/