def getBlitemFromRequest(key, value, labels): slug = key[3:] typex = key[:2] blitem = {} blitem['t'] = typex blitem['s'] = slug if BControl.isMultitext(typex): value = BControl.autoP(value) elif BControl.isMp3(typex): song = Song() song.load(value) value = song.dumpSong() elif BControl.isImage(typex): value = ObjectId(value) blitem['v'] = value blitem['l'] = labels.get(slug) return blitem
def test_isMp3(self): print 'MP3: ' + str(BControl.MP3) + ' -' + BControl.getType(BControl.MP3) + ' - ' + str(BControl.isMp3('1f'))