Update: Changed dispatcher to if.

--
Sincerely,  
Alexander Kryklia
Отправлено при помощи Sparrow (http://www.sparrowmailapp.com/?sig)


пятница, 14 февраля 2014 г. в 10:56, Anton Stupak написал:

> In common/lib/xmodule/xmodule/video_module/video_module.py:
> > > - @XBlock.handler > - def download_transcript(self, __, ___): > + if lang != self.transcript_language: > + self.transcript_language = lang > + > + dispatcher = { > + 'download': self.download_to_student, > + 'translation': self.translation, > + } > + > + return dispatcher[dispatch](request.GET)  
> > Are there going to be more entries in this dispatch dict eventually? For just two, I'd use an if/elif, especially since not all the dispatched functions want the same arguments.
>  
> Yes, we suppose extend this dictionary in future.
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/edx/edx-platform/pull/2422/files#r9742293).
>  
>  
>