From a7ae36cb4f8cbcd09fc2ff5a99e73a5a017e4899 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Sun, 21 May 2017 12:58:13 +0200 Subject: [PATCH] Remove redundant media from method name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using `fe.media.media_content(…)` is quite redundant. iThis patch changes the name to `fe.media.content(…)`. The same goes for the thumbnail method. Part of #58 --- feedgen/ext/media.py | 10 +++++----- tests/test_extension.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/feedgen/ext/media.py b/feedgen/ext/media.py index e947f8a..0410274 100644 --- a/feedgen/ext/media.py +++ b/feedgen/ext/media.py @@ -87,10 +87,10 @@ class MediaEntryExtension(BaseEntryExtension): def extend_rss(self, item): return self.extend_atom(item) - def media_content(self, url=None, fileSize=None, type=None, medium=None, - isDefault=None, expression=None, bitrate=None, - framerate=None, samplingrate=None, channels=None, - duration=None, height=None, width=None, lang=None): + def content(self, url=None, fileSize=None, type=None, medium=None, + isDefault=None, expression=None, bitrate=None, framerate=None, + samplingrate=None, channels=None, duration=None, height=None, + width=None, lang=None): ''' is a sub-element of either or . Media objects that are not the same content should not be included in the same element. The sequence of these items implies @@ -152,7 +152,7 @@ class MediaEntryExtension(BaseEntryExtension): return self.__media_content - def media_thumbnail(self, url=None, height=None, width=None, time=None): + def thumbnail(self, url=None, height=None, width=None, time=None): '''Allows particular images to be used as representative images for the media object. If multiple thumbnails are included, and time coding is not at play, it is assumed that the images are in order diff --git a/tests/test_extension.py b/tests/test_extension.py index bcb58bb..fc69198 100644 --- a/tests/test_extension.py +++ b/tests/test_extension.py @@ -211,7 +211,7 @@ class TestExtensionMedia(unittest.TestCase): fe.id('id') fe.title('title') fe.content('content') - fe.media.media_content(url='file1.xy') + fe.media.content(url='file1.xy') ns = {'media': 'http://search.yahoo.com/mrss/', 'a': 'http://www.w3.org/2005/Atom'}