Unified format for docstrings: 3x double quote used instead of 3x single quote

This commit is contained in:
codesparkle 2014-05-16 16:14:34 +10:00
parent 05ee2b6dad
commit c9b32da1ec
5 changed files with 15 additions and 15 deletions

View File

@ -35,10 +35,10 @@ def try_rm(filename):
def report_warning(message): def report_warning(message):
''' """
Print the message to stderr, it will be prefixed with 'WARNING:' Print the message to stderr, it will be prefixed with 'WARNING:'
If stderr is a tty file the 'WARNING:' will be colored If stderr is a tty file the 'WARNING:' will be colored
''' """
if sys.stderr.isatty() and os.name != 'nt': if sys.stderr.isatty() and os.name != 'nt':
_msg_header = u'\033[0;33mWARNING:\033[0m' _msg_header = u'\033[0;33mWARNING:\033[0m'
else: else:

View File

@ -376,10 +376,10 @@ class YoutubeDL(object):
self._download_retcode = 1 self._download_retcode = 1
def report_warning(self, message): def report_warning(self, message):
''' """
Print the message to stderr, it will be prefixed with 'WARNING:' Print the message to stderr, it will be prefixed with 'WARNING:'
If stderr is a tty file the 'WARNING:' will be colored If stderr is a tty file the 'WARNING:' will be colored
''' """
if self.params.get('logger') is not None: if self.params.get('logger') is not None:
self.params['logger'].warning(message) self.params['logger'].warning(message)
else: else:
@ -393,10 +393,10 @@ class YoutubeDL(object):
self.to_stderr(warning_message) self.to_stderr(warning_message)
def report_error(self, message, tb=None): def report_error(self, message, tb=None):
''' """
Do the same as trouble, but prefixes the message with 'ERROR:', colored Do the same as trouble, but prefixes the message with 'ERROR:', colored
in red if stderr is a tty file. in red if stderr is a tty file.
''' """
if self._err_file.isatty() and os.name != 'nt': if self._err_file.isatty() and os.name != 'nt':
_msg_header = '\033[0;31mERROR:\033[0m' _msg_header = '\033[0;31mERROR:\033[0m'
else: else:
@ -487,17 +487,17 @@ class YoutubeDL(object):
@staticmethod @staticmethod
def add_extra_info(info_dict, extra_info): 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(): for key, value in extra_info.items():
info_dict.setdefault(key, value) info_dict.setdefault(key, value)
def extract_info(self, url, download=True, ie_key=None, extra_info={}, def extract_info(self, url, download=True, ie_key=None, extra_info={},
process=True): process=True):
''' """
Returns a list with a dictionary for each video we find. Returns a list with a dictionary for each video we find.
If 'download', also downloads the videos. If 'download', also downloads the videos.
extra_info is a dict containing the extra values to add to each result extra_info is a dict containing the extra values to add to each result
''' """
if ie_key: if ie_key:
ies = [self.get_info_extractor(ie_key)] ies = [self.get_info_extractor(ie_key)]
@ -1019,7 +1019,7 @@ class YoutubeDL(object):
if success: if success:
try: try:
self.post_process(filename, info_dict) self.post_process(filename, info_dict)
except (PostProcessingError) as err: except PostProcessingError as err:
self.report_error('postprocessing: %s' % str(err)) self.report_error('postprocessing: %s' % str(err))
return return
@ -1298,7 +1298,7 @@ class YoutubeDL(object):
try: try:
return s.encode(self.get_encoding()) return s.encode(self.get_encoding())
except UnicodeEncodeError as err: 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 raise
def get_encoding(self): def get_encoding(self):

View File

@ -158,7 +158,7 @@ def parseOpts(overrideArguments=None):
return userConf return userConf
def _format_option_string(option): def _format_option_string(option):
''' ('-o', '--option') -> -o, --format METAVAR''' """ ('-o', '--option') -> -o, --format METAVAR"""
opts = [] opts = []

View File

@ -6,13 +6,13 @@ from .common import InfoExtractor
from ..utils import ExtractorError from ..utils import ExtractorError
class Channel9IE(InfoExtractor): class Channel9IE(InfoExtractor):
''' """
Common extractor for channel9.msdn.com. Common extractor for channel9.msdn.com.
The type of provided URL (video or playlist) is determined according to 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 meta Search.PageType from web page HTML rather than URL itself, as it is
not always possible to do. not always possible to do.
''' """
IE_DESC = 'Channel 9' IE_DESC = 'Channel 9'
IE_NAME = 'channel9' IE_NAME = 'channel9'
_VALID_URL = r'https?://(?:www\.)?channel9\.msdn\.com/(?P<contentpath>.+)/?' _VALID_URL = r'https?://(?:www\.)?channel9\.msdn\.com/(?P<contentpath>.+)/?'

View File

@ -86,7 +86,7 @@ class TEDIE(SubtitlesInfoExtractor):
return self._playlist_videos_info(url, name) return self._playlist_videos_info(url, name)
def _playlist_videos_info(self, 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, webpage = self._download_webpage(url, name,
'Downloading playlist webpage') 'Downloading playlist webpage')