From d8e17d474b910ab7a642d0462745415099d6ddb2 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sat, 13 Dec 2014 21:51:33 +0200 Subject: [PATCH] Setup: Add __main__.py in /usr/bin --- setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 78364f6..f72a994 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import os import sys +import shutil PY2EXE = len(sys.argv) >= 2 and sys.argv[1] == 'py2exe' @@ -40,6 +41,13 @@ LINUX_ICONS = '/usr/share/icons/hicolor/' LINUX_FALLBACK_ICONS = '/usr/share/pixmaps/' +def create_scripts(): + if not os.path.exists('build/_scripts/'): + os.makedirs('build/_scripts') + + shutil.copyfile('youtube_dl_gui/__main__.py', 'build/_scripts/youtube-dl-gui') + + def py2exe_setup(): py2exe_dependencies = [ 'C:\\Windows\\System32\\ffmpeg.exe', @@ -78,6 +86,8 @@ def normal_setup(): if os.name == 'nt': icons_dir = (WINDOWS_ICONS, ICONS_LIST) data_files.append(icons_dir) + + params = {'data_files': data_files} else: # Create all the hicolor icons for index, size in enumerate(ICONS_SIZES): @@ -90,7 +100,8 @@ def normal_setup(): fallback_icon = (LINUX_FALLBACK_ICONS, [ICONS_LIST[2]]) data_files.append(fallback_icon) - params = {'data_files': data_files} + create_scripts() + params = {'data_files': data_files, 'scripts': ['build/_scripts/youtube-dl-gui']} return params