def __call__(self, abctext, uuid, makeMP3): # need to remove 'view' at the end if present abctune = uuidToObject(uuid) sm = getSecurityManager() if not sm.checkPermission(ModifyPortalContent, abctune): return abctune.abc = abctext addTuneType(abctune) addOrigins(abctune) addKeys(abctune) _make_midi(abctune) _make_score(abctune) # _make_PDFscore(abctune) if makeMP3 != '0': _make_mp3(abctune) logger.info('lance _make_mp3') # import pdb;pdb.set_trace() abctune.modification_date = DateTime() logger.info(abctune.modified()) logger.info('"' + abctune.title + '" updated') parent = abctune.aq_parent if parent.portal_type == 'abctuneset': # logger.info('in updateTune.updateTune') updateTuneSet(parent) site = getSite() catalog = site.portal_catalog catalog.reindexObject(abctune) return 1
def __call__(self, abctext, uuid): abctune = uuidToObject(uuid) sm = getSecurityManager() if not sm.checkPermission(ModifyPortalContent, abctune): return abctune.abc = abctext _make_mp3(abctune) retour = '<embed id="abctuneMP3" height="30" autostart="false" ' retour += 'controller="true" autoplay="true"' retour += ' src="' + abctune.absolute_url() + '/@@download/sound/' retour += abctune.sound.filename + '"' retour += ' type="audio/mp3"> </embed>' return retour
def __call__(self): context = self.context folder_path = '/'.join(context.getPhysicalPath()) site = getSite() catalog = site.portal_catalog results = catalog.searchResults(portal_type='abctune', path={'query': folder_path, 'depth': 1}, ) for result in results: tune = result.getObject() if not tune.sound: logger.info('Create MP3 for : ' + tune.title) _make_mp3(tune) return