From c9b32da1eccd2d50ed6549b44c75d651224b05b3 Mon Sep 17 00:00:00 2001 From: codesparkle Date: Fri, 16 May 2014 16:14:34 +1000 Subject: [PATCH] Unified format for docstrings: 3x double quote used instead of 3x single quote --- test/helper.py | 4 ++-- youtube_dl/YoutubeDL.py | 18 +++++++++--------- youtube_dl/__init__.py | 2 +- youtube_dl/extractor/channel9.py | 4 ++-- youtube_dl/extractor/ted.py | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/helper.py b/test/helper.py index 230d2bd67..b020caa11 100644 --- a/test/helper.py +++ b/test/helper.py @@ -35,10 +35,10 @@ def try_rm(filename): def report_warning(message): - ''' + """ Print the message to stderr, it will be prefixed with 'WARNING:' If stderr is a tty file the 'WARNING:' will be colored - ''' + """ if sys.stderr.isatty() and os.name != 'nt': _msg_header = u'\033[0;33mWARNING:\033[0m' else: diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index f3666573a..e99d9a74a 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -376,10 +376,10 @@ class YoutubeDL(object): self._download_retcode = 1 def report_warning(self, message): - ''' + """ Print the message to stderr, it will be prefixed with 'WARNING:' If stderr is a tty file the 'WARNING:' will be colored - ''' + """ if self.params.get('logger') is not None: self.params['logger'].warning(message) else: @@ -393,10 +393,10 @@ class YoutubeDL(object): self.to_stderr(warning_message) def report_error(self, message, tb=None): - ''' + """ Do the same as trouble, but prefixes the message with 'ERROR:', colored in red if stderr is a tty file. - ''' + """ if self._err_file.isatty() and os.name != 'nt': _msg_header = '\033[0;31mERROR:\033[0m' else: @@ -487,17 +487,17 @@ class YoutubeDL(object): @staticmethod def add_extra_info(info_dict, extra_info): - '''Set the keys from extra_info in info dict if they are missing''' + """Set the keys from extra_info in info dict if they are missing""" for key, value in extra_info.items(): info_dict.setdefault(key, value) def extract_info(self, url, download=True, ie_key=None, extra_info={}, process=True): - ''' + """ Returns a list with a dictionary for each video we find. If 'download', also downloads the videos. extra_info is a dict containing the extra values to add to each result - ''' + """ if ie_key: ies = [self.get_info_extractor(ie_key)] @@ -1019,7 +1019,7 @@ class YoutubeDL(object): if success: try: self.post_process(filename, info_dict) - except (PostProcessingError) as err: + except PostProcessingError as err: self.report_error('postprocessing: %s' % str(err)) return @@ -1298,7 +1298,7 @@ class YoutubeDL(object): try: return s.encode(self.get_encoding()) except UnicodeEncodeError as err: - err.reason = err.reason + '. Check your system encoding configuration or use the --encoding option.' + err.reason += '. Check your system encoding configuration or use the --encoding option.' raise def get_encoding(self): diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 4e657e297..be85de025 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -158,7 +158,7 @@ def parseOpts(overrideArguments=None): return userConf def _format_option_string(option): - ''' ('-o', '--option') -> -o, --format METAVAR''' + """ ('-o', '--option') -> -o, --format METAVAR""" opts = [] diff --git a/youtube_dl/extractor/channel9.py b/youtube_dl/extractor/channel9.py index 4f000292b..515701cef 100644 --- a/youtube_dl/extractor/channel9.py +++ b/youtube_dl/extractor/channel9.py @@ -6,13 +6,13 @@ from .common import InfoExtractor from ..utils import ExtractorError class Channel9IE(InfoExtractor): - ''' + """ Common extractor for channel9.msdn.com. The type of provided URL (video or playlist) is determined according to meta Search.PageType from web page HTML rather than URL itself, as it is not always possible to do. - ''' + """ IE_DESC = 'Channel 9' IE_NAME = 'channel9' _VALID_URL = r'https?://(?:www\.)?channel9\.msdn\.com/(?P.+)/?' diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py index d260c91c2..02cac714f 100644 --- a/youtube_dl/extractor/ted.py +++ b/youtube_dl/extractor/ted.py @@ -86,7 +86,7 @@ class TEDIE(SubtitlesInfoExtractor): return self._playlist_videos_info(url, name) def _playlist_videos_info(self, url, name): - '''Returns the videos of the playlist''' + """Returns the videos of the playlist""" webpage = self._download_webpage(url, name, 'Downloading playlist webpage')