eit.py

changeset 6
1420abafd049
parent 2
319f8c3fd394
child 9
1bf778001041
equal deleted inserted replaced
5:51e57e9f8db1 6:1420abafd049
26 # <http://www.gnu.org/licenses/>. 26 # <http://www.gnu.org/licenses/>.
27 # 27 #
28 28
29 # seite 36, inhalt der for schleife! 29 # seite 36, inhalt der for schleife!
30 # https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf 30 # https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf
31
32 #pylint: disable=missing-docstring
33 #pylint: disable=line-too-long
31 34
32 import os 35 import os
33 import struct 36 import struct
34 import sys 37 import sys
35 import getopt 38 import getopt
132 if name == language: 135 if name == language:
133 if len(alpha) == 3: 136 if len(alpha) == 3:
134 return alpha 137 return alpha
135 return ret 138 return ret
136 139
137 class EitList(object): 140 class eitinfo(object):
138 """Eit File support class 141 """Eit File support class
139 Description 142 Description
140 http://de.wikipedia.org/wiki/Event_Information_Table 143 http://de.wikipedia.org/wiki/Event_Information_Table
141 """ 144 """
142 def __init__(self, path=None): 145 def __init__(self, path=None):
354 357
355 def readeit(eitfile): 358 def readeit(eitfile):
356 """Module docstring. 359 """Module docstring.
357 Read Eit File and show the information. 360 Read Eit File and show the information.
358 """ 361 """
359 eitlist = EitList(eitfile) 362 eitlist = eitinfo(eitfile)
360 print "Name: ", eitlist.get_name() 363 out = "Movie name: %s" % eitlist.get_name()
361 print "Genre: ", eitlist.get_genre() 364 out += "\nGenre: %s" % eitlist.get_genre()
362 print "Components: ", eitlist.get_components() 365 out += "\nComponents: %s" % eitlist.get_components()
363 print "StartDate: ", eitlist.get_date() 366 out += "\nStartDate: %s" % eitlist.get_date()
364 print "Description: ", eitlist.get_description() 367 out += "\nDescription: %s" % eitlist.get_description()
365 print "Duration: ", eitlist.get_duration() 368 out += "\nDuration: %02i:%02i:%02i" % eitlist.get_duration()
366 print "Minutes: ", eitlist.get_duration_seconds() / 60 369 out += " (%s minutes)" % (eitlist.get_duration_seconds() / 60)
367 370
368 #eitlist.dumpEit() 371 print out
372 return out
369 373
370 def main(): 374 def main():
371 # parse command line options 375 # parse command line options
372 try: 376 try:
373 opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) 377 opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])

mercurial