Beispiel #1
0
 def LireM3u(self, CheminxAmAx, F4m=False, cvNom=True):
     print "Liste de chaine M3u"
     dialog = Dialog()
     fn = dialog.browse(1, 'Ouvrir le fichier M3u', 'files', '.m3u|.m3u8',
                        False, False, 'special://home')
     ret = []
     if fn != False and fn != "":
         if exists(fn):
             f = File(fn)
             M3u = f.read()
             f.close()
             if M3u != "":
                 ret = self.TabM3u(M3u, F4m, cvNom)
     return ret
Beispiel #2
0
def _parse_file(filename):
    """Extract metatata from file"""
    # Workaround to fix unicode path problem on different OSs
    if sys.platform == 'win32':
        f = open(filename, 'rb')
    else:
        f = File(filename)
    try:
        s = StringIO(f.read(1024 * 64))
        p = guessParser(InputIOStream(s, filename=unicode(filename), tags=[]))
        metadata = extractMetadata(p)
    finally:
        f.close()
    return metadata
 def get_playing_file_size(self):
     f = File(self.video_file_name)
     s = f.size()
     f.close()
     return s