diff options
author | Thomas "Cakeisalie5" Touhey <thomas@touhey.fr> | 2018-08-25 17:38:24 +0200 |
---|---|---|
committer | Thomas "Cakeisalie5" Touhey <thomas@touhey.fr> | 2018-08-25 17:38:24 +0200 |
commit | ea98e48a15dd4f3145d8eb55ddc061c1008d4212 (patch) | |
tree | 38c3ec8b62789f3dc9d3a2cd522c52c802dd954e /textoutpc/builtin/_Video.py | |
parent | 4774189495cd43ab2d12c310d2728d951d41468e (diff) |
Corn flake8
Diffstat (limited to 'textoutpc/builtin/_Video.py')
-rwxr-xr-x | textoutpc/builtin/_Video.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/textoutpc/builtin/_Video.py b/textoutpc/builtin/_Video.py index 2dbbc63..b20dc45 100755 --- a/textoutpc/builtin/_Video.py +++ b/textoutpc/builtin/_Video.py @@ -14,11 +14,12 @@ __all__ = ["VideoTag", "YoutubeTag"] _defaultratio_w = 16 _defaultratio_h = 9 + class VideoTag(_BlockTag): """ The video tag, puts a preview of the video whose URL is given. Only a few 'big' services are supported for now. Example uses: - + [video]video_url[/video] [video=4:3]video_url[/video] [video tiny]video_url[/video tiny] @@ -77,7 +78,7 @@ class VideoTag(_BlockTag): self._video = self.video(content) except: url = _urlparse.urlparse(content) - if not url.scheme in ('http', 'https'): + if url.scheme not in ('http', 'https'): raise Exception("No allowed prefix!") self._video = content @@ -117,10 +118,11 @@ class VideoTag(_BlockTag): url = self._url.replace('[', '%5B').replace(']', '%5D') return '[[image:{}]]'.format(url) + class YoutubeTag(VideoTag): """ Alias for the video tag with only the Youtube possibility. Example uses: - + [youtube]okMK1NYRySI[/youtube] """ aliases = ('[youtube]',) |