Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- #
- # Save: upcoming_check.py
- # Do: chmod 755 upcoming_check.py
- # Run: ./upcoming_check.py
- # Written by Bill Meek, http://www.gossamer-threads.com/lists/mythtv/users/577513#577513
- # Prints a list of upcoming recordings
- #
- from MythTV import MythBE
- import re,sys
- try:
- be = MythBE()
- except:
- print 'Unable to connect to the backend'
- sys.exit(1)
- headingNotPrinted = True
- upcomingCount = 0
- for recording in be.getUpcomingRecordings():
- if headingNotPrinted:
- print '\nUpcoming recordings...'
- print '\n chanid Starttime\t\tTitle\t\t Subtitle'
- headingNotPrinted = False
- print u' {0:<7} {1}\t{2:<20.20} {3:<29.29}' \
- .format(recording.chanid,
- recording.starttime.strftime("%b %d %Y %H:%M"),
- recording.title,
- recording.subtitle)
- upcomingCount = upcomingCount + 1
- print '\n Upcoming Shows: {0}.\n'.format(upcomingCount)
- headingNotPrinted = True
- conflictCount = 0
- # The following is commented out because getConflictedRecordings isn't
- # available in 0.21.
- # for recording in be.getConflictedRecordings():
- # if headingNotPrinted:
- # print '\nAll conflicts...'
- # print '\n ChanID Starttime\t\tTitle'
- # headingNotPrinted = False
- # print u' {0} {1}\t{2}' \
- # .format(recording.chanid,
- # recording.starttime.strftime("%b %d %Y %H:%M"),
- # recording.title)
- # conflictCount = conflictCount + 1
- #
- # if conflictCount:
- # print '\n Conflicts: {0}.\n'.format(conflictCount)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement