From a777915c2563b94a96ab3948fcb57f4e3369c666 2013-04-19 23:17:01 From: Eugene Van den Bulke Date: 2013-04-19 23:17:01 Subject: [PATCH] using named keys and format string method + renaming VideoIframe to VideoIFrame --- diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 3cc55bf..d919902 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -6,7 +6,7 @@ from os.path import exists, isfile, splitext, abspath, join, isdir from os import walk, sep -class VideoIframe(object): +class VideoIFrame(object): """ Generic class to embed videos in a iframe """ @@ -24,9 +24,12 @@ class VideoIframe(object): params = "?" + urlencode(self.params) else: params = "" - return self.iframe % (self.width, self.height, self.id, params) + return self.iframe.format(width=self.width, + height=self.height, + id=self.id, + params=params) -class YouTubeVideo(VideoIframe): +class YouTubeVideo(VideoIFrame): """Class for embedding a YouTube Video in an IPython session, based on its video id. e.g. to embed the video on this page: @@ -52,24 +55,24 @@ class YouTubeVideo(VideoIframe): iframe = """ """ -class VimeoVideo(VideoIframe): +class VimeoVideo(VideoIFrame): """ Class for embedding a Vimeo video in an IPython session, based on its video id. """ iframe = """