Browse Source

Setup: Add __main__.py in /usr/bin

doc-issue-template
MrS0m30n3 10 years ago
parent
commit
d8e17d474b
1 changed files with 12 additions and 1 deletions
  1. 13
      setup.py

13
setup.py

@ -2,6 +2,7 @@
import os import os
import sys import sys
import shutil
PY2EXE = len(sys.argv) >= 2 and sys.argv[1] == 'py2exe' 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/' 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(): def py2exe_setup():
py2exe_dependencies = [ py2exe_dependencies = [
'C:\\Windows\\System32\\ffmpeg.exe', 'C:\\Windows\\System32\\ffmpeg.exe',
@ -78,6 +86,8 @@ def normal_setup():
if os.name == 'nt': if os.name == 'nt':
icons_dir = (WINDOWS_ICONS, ICONS_LIST) icons_dir = (WINDOWS_ICONS, ICONS_LIST)
data_files.append(icons_dir) data_files.append(icons_dir)
params = {'data_files': data_files}
else: else:
# Create all the hicolor icons # Create all the hicolor icons
for index, size in enumerate(ICONS_SIZES): for index, size in enumerate(ICONS_SIZES):
@ -90,7 +100,8 @@ def normal_setup():
fallback_icon = (LINUX_FALLBACK_ICONS, [ICONS_LIST[2]]) fallback_icon = (LINUX_FALLBACK_ICONS, [ICONS_LIST[2]])
data_files.append(fallback_icon) 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 return params

Loading…
Cancel
Save