# HG changeset patch # User souliane # Date 1394537489 -3600 # Node ID 462fc3359ee38a9a0470d78d5088026e82727631 # Parent 6148e90630696db331ccb97f58f92742227dbd55 browser_side: radiocol accepts mime type audio/mp3 in addition to audio/mpeg diff -r 6148e9063069 -r 462fc3359ee3 browser_side/file_tools.py --- a/browser_side/file_tools.py Tue Mar 11 11:53:03 2014 +0100 +++ b/browser_side/file_tools.py Tue Mar 11 12:31:29 2014 +0100 @@ -58,7 +58,10 @@ return False (size, filetype) = self.getFileInfo() if self.types and filetype not in [x for (x, y, z) in self.types]: - types = ["- %s (%s)" % (z, y) for (x, y, z) in self.types] + types = [] + for type_ in ["- %s (%s)" % (z, y) for (x, y, z) in self.types]: + if type_ not in types: + types.append(type_) Window.alert('This file type is not accepted.\nAccepted file types are:\n\n%s' % "\n".join(types)) return False if size > self.max_size * pow(2, 20): diff -r 6148e9063069 -r 462fc3359ee3 browser_side/radiocol.py --- a/browser_side/radiocol.py Tue Mar 11 11:53:03 2014 +0100 +++ b/browser_side/radiocol.py Tue Mar 11 12:31:29 2014 +0100 @@ -88,7 +88,9 @@ types = [('audio/ogg', '*.ogg', 'Ogg Vorbis Audio'), ('video/ogg', '*.ogv', 'Ogg Vorbis Video'), ('application/ogg', '*.ogx', 'Ogg Vorbis Multiplex'), - ('audio/mpeg', '*.mp3', 'MPEG-Layer 3')] + ('audio/mpeg', '*.mp3', 'MPEG-Layer 3'), + ('audio/mp3', '*.mp3', 'MPEG-Layer 3'), + ] self.file_upload = FilterFileUpload("song", 10, types) vPanel.add(self.file_upload)