Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing blank lines after class or function definition. #10689

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions devscripts/bash-completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ def build_completion(opt_parser):
filled_template = template.replace("{{flags}}", " ".join(opts_flag))
f.write(filled_template)


parser = youtube_dl.parseOpts()[0]
build_completion(parser)
1 change: 1 addition & 0 deletions devscripts/fish-completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ def build_completion(opt_parser):
with open(FISH_COMPLETION_FILE, 'w') as f:
f.write(filled_template)


parser = youtube_dl.parseOpts()[0]
build_completion(parser)
1 change: 1 addition & 0 deletions devscripts/generate_aes_testdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def openssl_encode(algo, key, iv):
out, _ = prog.communicate(secret_msg)
return out


iv = key = [0x20, 0x15] + 14 * [0]

r = openssl_encode('aes-128-cbc', key, iv)
Expand Down
1 change: 1 addition & 0 deletions devscripts/gh-pages/update-sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ def main():
with open('supportedsites.html', 'w', encoding='utf-8') as sitesf:
sitesf.write(template)


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions devscripts/make_contributing.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ def main():
with io.open(outfile, 'w', encoding='utf-8') as outf:
outf.write(out)


if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions devscripts/make_lazy_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ def build_lazy_ie(ie, name):
s += make_valid_template.format(valid_url=ie._make_valid_url())
return s


# find the correct sorting and add the required base classes so that sublcasses
# can be correctly created
classes = _ALL_CLASSES[:-1]


ordered_cls = []
while classes:
for c in classes[:]:
Expand Down
1 change: 1 addition & 0 deletions devscripts/make_supportedsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ def gen_ies_md(ies):
with io.open(outfile, 'w', encoding='utf-8') as outf:
outf.write(out)


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions devscripts/prepare_manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ def filter_options(readme):

return ret


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions devscripts/zsh-completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ def build_completion(opt_parser):
with open(ZSH_COMPLETION_FILE, "w") as f:
f.write(template)


parser = youtube_dl.parseOpts()[0]
build_completion(parser)
1 change: 1 addition & 0 deletions test/test_InfoExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ def test_download_json(self):
self.assertRaises(ExtractorError, self.ie._download_json, uri, None)
self.assertEqual(self.ie._download_json(uri, None, fatal=False), None)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ def test_decrypt_text(self):
decrypted = (aes_decrypt_text(encrypted, password, 32))
self.assertEqual(decrypted, self.secret_msg)


if __name__ == '__main__':
unittest.main()
2 changes: 2 additions & 0 deletions test/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def _file_md5(fn):
with open(fn, 'rb') as f:
return hashlib.md5(f.read()).hexdigest()


defs = gettestcases()


Expand Down Expand Up @@ -217,6 +218,7 @@ def try_rm_tcs_files(tcs=None):

return test_template


# And add them to TestDownload
for n, test_case in enumerate(defs):
test_method = generator(test_case)
Expand Down
1 change: 1 addition & 0 deletions test/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ def test_cmdline_umlauts(self):
_, stderr = p.communicate()
self.assertFalse(stderr)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,6 @@ def test_proxy_with_idn(self):
# b'xn--fiq228c' is '中文'.encode('idna')
self.assertEqual(response, 'normal: http://xn--fiq228c.tw/')


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_iqiyi_sdk_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ def test_iqiyi_sdk_interpreter(self):
ie._login()
self.assertTrue('unable to log in:' in logger.messages[0])


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,5 +1065,6 @@ def test_get_element_by_class(self):
self.assertEqual(get_element_by_class('foo', html), 'nice')
self.assertEqual(get_element_by_class('no-such-class', html), None)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_verbose_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ def test_private_info_shortarg_eq(self):
self.assertTrue(b'-p' in serr)
self.assertTrue(b'secret' not in serr)


if __name__ == '__main__':
unittest.main()
2 changes: 2 additions & 0 deletions test/test_write_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self, *args, **kwargs):
super(YoutubeDL, self).__init__(*args, **kwargs)
self.to_stderr = self.to_screen


params = get_params({
'writeannotations': True,
'skip_download': True,
Expand Down Expand Up @@ -74,5 +75,6 @@ def test_info_json(self):
def tearDown(self):
try_rm(ANNOTATIONS_FILE)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_youtube_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ def test_youtube_flat_playlist_titles(self):
for entry in result['entries']:
self.assertTrue(entry.get('title'))


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions test/test_youtube_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def test_func(self):
test_func.__name__ = str('test_signature_' + stype + '_' + test_id)
setattr(TestSignature, test_func.__name__, test_func)


for test_spec in _TESTS:
make_tfunc(*test_spec)

Expand Down
1 change: 1 addition & 0 deletions youtube_dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,5 @@ def main(argv=None):
except KeyboardInterrupt:
sys.exit('\nERROR: Interrupted by user')


__all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors']
2 changes: 2 additions & 0 deletions youtube_dl/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def next_value(self):

return plaintext


RCON = (0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36)
SBOX = (0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
Expand Down Expand Up @@ -328,4 +329,5 @@ def inc(data):
break
return data


__all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text']
2 changes: 2 additions & 0 deletions youtube_dl/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,7 @@ class _TreeBuilder(etree.TreeBuilder):
def doctype(self, name, pubid, system):
pass


if sys.version_info[0] >= 3:
def compat_etree_fromstring(text):
return etree.XML(text, parser=etree.XMLParser(target=_TreeBuilder()))
Expand Down Expand Up @@ -2787,6 +2788,7 @@ def _compat_add_option(self, *args, **kwargs):
return real_add_option(self, *bargs, **bkwargs)
optparse.OptionGroup.add_option = _compat_add_option


if hasattr(shutil, 'get_terminal_size'): # Python >= 3.3
compat_get_terminal_size = shutil.get_terminal_size
else:
Expand Down
1 change: 1 addition & 0 deletions youtube_dl/downloader/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def _call_downloader(self, tmpfilename, info_dict):
class AVconvFD(FFmpegFD):
pass


_BY_NAME = dict(
(klass.get_basename(), klass)
for name, klass in globals().items()
Expand Down
2 changes: 2 additions & 0 deletions youtube_dl/extractor/theplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
)

default_ns = 'http://www.w3.org/2005/SMIL21/Language'


_x = lambda p: xpath_with_ns(p, {'smil': default_ns})


Expand Down
1 change: 1 addition & 0 deletions youtube_dl/socks.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class ProxyType(object):
SOCKS4A = 1
SOCKS5 = 2


Proxy = collections.namedtuple('Proxy', (
'type', 'host', 'port', 'username', 'password', 'remote_dns'))

Expand Down
3 changes: 3 additions & 0 deletions youtube_dl/swfinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def _u30(reader):
res = _read_int(reader)
assert res & 0xf0000000 == 0
return res


_u32 = _read_int


Expand Down Expand Up @@ -176,6 +178,7 @@ def __str__(self):
return 'undefined'
__repr__ = __str__


undefined = _Undefined()


Expand Down