From 59ae15a507cbf93de13f8fda8444d2d9a251747a Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 28 Nov 2012 02:04:46 +0100 Subject: Convert all tabs to 4 spaces (PEP8) --- youtube_dl/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index 6f20402e2..acb36e770 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -4,4 +4,4 @@ import __init__ if __name__ == '__main__': - __init__.main() + __init__.main() -- cgit v1.2.3 From 9e8056d5a7b6b366874088cd30d23ba4a52d3861 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 28 Nov 2012 03:34:40 +0100 Subject: Use relative imports --- youtube_dl/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index acb36e770..8c12bfb64 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import __init__ +import youtube_dl if __name__ == '__main__': - __init__.main() + youtube_dl.main() -- cgit v1.2.3 From f1cb5bcad2bf2983b584730164238adcd8fa7e94 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 28 Nov 2012 03:55:35 +0100 Subject: Make __main__ work in all scenarios with relative imports --- youtube_dl/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index 8c12bfb64..ccc782bec 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- + +# Execute with python -m youtube_dl import youtube_dl -- cgit v1.2.3 From 743b28ce1155df348bbb828fcb316d57c8704328 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 29 Nov 2012 15:11:24 +0100 Subject: Allow youtube_dl/__main__.py to be called directly --- youtube_dl/__main__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index ccc782bec..0910e9d15 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -1,6 +1,14 @@ #!/usr/bin/env python -# Execute with python -m youtube_dl +# Execute with +# $ python youtube_dl/__main__.py (2.6+) +# $ python -m youtube_dl (2.7+) + +import sys + +if __package__ is None: + import os.path + sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import youtube_dl -- cgit v1.2.3 From fec89790b19d804eecb7318e5da64dbb1445c7f0 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 7 Dec 2012 12:04:52 +0100 Subject: and now, also py2exe compiles fine :) (on Windows) --- youtube_dl/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index 0910e9d15..7f8410f2a 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -6,7 +6,7 @@ import sys -if __package__ is None: +if __package__ is None and not hasattr(sys, "frozen"): import os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -- cgit v1.2.3 From 5a304a7637c033dea00ff46d6980075b63d17f24 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sat, 8 Dec 2012 00:48:07 +0100 Subject: new updating scheme, based on GH downloads; also, check if not updateable (pip installed) --- youtube_dl/__main__.py | 1 + 1 file changed, 1 insertion(+) (limited to 'youtube_dl/__main__.py') diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index 7f8410f2a..7022ea4be 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -7,6 +7,7 @@ import sys if __package__ is None and not hasattr(sys, "frozen"): + # direct call of __main__.py import os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -- cgit v1.2.3