On Thu, Jul 17, 2008 at 04:55:42PM -0400, Paul Kienzle wrote: > On Thu, Jul 17, 2008 at 09:44:48PM +0200, David M. Kaplan wrote: > > Another option would be to create a start_event_loop function like Paul > > suggested and overload that function in those backends that aren't > > interactive so that it returns an error, but this requires writing one > > such function for each non-interactive backend.
> Either create a deeper hierarchy: > FigureCanvasBase: > def start_event_loop(self, ...): > raise NotImplemented > FigureCanvasInteractive: > def start_event_loop(self, ...): > generic interactive using time.sleep > MyInteractiveBackend(FigureCanvasInteractive): > def start_event_loop(self, ...): > specialized interactive code using GUI > or a mix-in class: > FigureCanvasBase: > def start_event_loop(self, ...): > raise NotImplemented > FigureCanvasEventLoopMixin: > def start_event_loop(self, ...): > generic interactive using time.sleep > MyInteractiveBackend(FigureCanvasBase,FigureCanvasEventLoopMixin): > ... no start_event_loop since using the generic mixin ... > I prefer the latter, particularly since it won't be needed once the > existing interactive backends are implemented. +1 one that. Also, I don't think a exception is a good idea. Simply a warnings.warn should be enough. Gaƫl ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel