186 return mkint(length) |
188 return mkint(length) |
187 |
189 |
188 def get_date(self): |
190 def get_date(self): |
189 return todate(self.get_startdate(), self.get_starttime()) |
191 return todate(self.get_startdate(), self.get_starttime()) |
190 |
192 |
191 def dumpEit(self): |
193 def dump(self): |
192 print self.eit |
194 """Module docstring. |
|
195 Read Eit File and show the information. |
|
196 """ |
|
197 if len(self.eit) == 0: |
|
198 return None |
|
199 out = "Movie name: %s" % self.get_name() |
|
200 out += "\nGenre: %s" % self.get_genre() |
|
201 out += "\nComponents: %s" % self.get_components() |
|
202 out += "\nStartDate: %s" % self.get_date() |
|
203 out += "\nDescription: %s" % self.get_description() |
|
204 out += "\nDuration: %02i:%02i:%02i" % self.get_duration() |
|
205 out += " (%s minutes)" % (self.get_duration_seconds() / 60) |
|
206 |
|
207 print out |
|
208 return out |
193 |
209 |
194 ############################################################################## |
210 ############################################################################## |
195 ## File IO Functions |
211 ## File IO Functions |
196 def _read_file(self): |
212 def _read_file(self): |
197 data = "" |
213 data = "" |
353 else: |
369 else: |
354 # No data clear all |
370 # No data clear all |
355 self.eit = {} |
371 self.eit = {} |
356 |
372 |
357 |
373 |
358 def readeit(eitfile): |
|
359 """Module docstring. |
|
360 Read Eit File and show the information. |
|
361 """ |
|
362 eitlist = eitinfo(eitfile) |
|
363 if len(eitlist.eit) == 0: |
|
364 return None |
|
365 out = "Movie name: %s" % eitlist.get_name() |
|
366 out += "\nGenre: %s" % eitlist.get_genre() |
|
367 out += "\nComponents: %s" % eitlist.get_components() |
|
368 out += "\nStartDate: %s" % eitlist.get_date() |
|
369 out += "\nDescription: %s" % eitlist.get_description() |
|
370 out += "\nDuration: %02i:%02i:%02i" % eitlist.get_duration() |
|
371 out += " (%s minutes)" % (eitlist.get_duration_seconds() / 60) |
|
372 |
|
373 print out |
|
374 return out |
|
375 |
374 |
376 def main(): |
375 def main(): |
377 # parse command line options |
376 # parse command line options |
378 try: |
377 try: |
379 opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) |
378 opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) |