|
@ -40,7 +40,7 @@ Notes: |
|
|
* Call setup handler based on OS & options |
|
|
* Call setup handler based on OS & options |
|
|
* Set up hicolor icons (if supported by platform) |
|
|
* Set up hicolor icons (if supported by platform) |
|
|
* Set up fallback pixmaps icon (if supported by platform) |
|
|
* Set up fallback pixmaps icon (if supported by platform) |
|
|
* Set up package level pixmaps icons (*.png, *.ico) |
|
|
|
|
|
|
|
|
* Set up package level pixmaps icons (*.png) |
|
|
* Set up package level i18n files (*.mo) |
|
|
* Set up package level i18n files (*.mo) |
|
|
* Set up scripts (executables) (if supported by platform) |
|
|
* Set up scripts (executables) (if supported by platform) |
|
|
* Run setup |
|
|
* Run setup |
|
@ -63,7 +63,7 @@ if PY2EXE: |
|
|
try: |
|
|
try: |
|
|
import py2exe |
|
|
import py2exe |
|
|
except ImportError as error: |
|
|
except ImportError as error: |
|
|
print error |
|
|
|
|
|
|
|
|
print(error) |
|
|
sys.exit(1) |
|
|
sys.exit(1) |
|
|
|
|
|
|
|
|
from youtube_dl_gui import ( |
|
|
from youtube_dl_gui import ( |
|
@ -82,6 +82,11 @@ from youtube_dl_gui import ( |
|
|
__packagename__ = str(__packagename__) |
|
|
__packagename__ = str(__packagename__) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def on_windows(): |
|
|
|
|
|
"""Returns True if OS is Windows.""" |
|
|
|
|
|
return os.name == "nt" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BuildBin(cmd.Command): |
|
|
class BuildBin(cmd.Command): |
|
|
|
|
|
|
|
|
description = "build the youtube-dl-gui binary file" |
|
|
description = "build the youtube-dl-gui binary file" |
|
@ -111,7 +116,7 @@ class BuildTranslations(cmd.Command): |
|
|
self.search_pattern = None |
|
|
self.search_pattern = None |
|
|
|
|
|
|
|
|
def finalize_options(self): |
|
|
def finalize_options(self): |
|
|
if os.name == "nt": |
|
|
|
|
|
|
|
|
if on_windows(): |
|
|
self.exec_name = "msgfmt.exe" |
|
|
self.exec_name = "msgfmt.exe" |
|
|
else: |
|
|
else: |
|
|
self.exec_name = "msgfmt" |
|
|
self.exec_name = "msgfmt" |
|
@ -170,10 +175,9 @@ def linux_setup(): |
|
|
("share/pixmaps", ["youtube_dl_gui/data/pixmaps/youtube-dl-gui.png"]) |
|
|
("share/pixmaps", ["youtube_dl_gui/data/pixmaps/youtube-dl-gui.png"]) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
# Add other package data |
|
|
|
|
|
|
|
|
# Add pixmaps icons (*.png) & i18n files |
|
|
package_data[__packagename__] = [ |
|
|
package_data[__packagename__] = [ |
|
|
"data/pixmaps/*.png", |
|
|
"data/pixmaps/*.png", |
|
|
"data/pixmaps/*.ico", |
|
|
|
|
|
"locale/*/LC_MESSAGES/*.mo" |
|
|
"locale/*/LC_MESSAGES/*.mo" |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
@ -193,10 +197,9 @@ def windows_setup(): |
|
|
def normal_setup(): |
|
|
def normal_setup(): |
|
|
package_data = {} |
|
|
package_data = {} |
|
|
|
|
|
|
|
|
# On Windows we dont use the icons under hicolor |
|
|
|
|
|
|
|
|
# Add pixmaps icons (*.png) & i18n files |
|
|
package_data[__packagename__] = [ |
|
|
package_data[__packagename__] = [ |
|
|
"data\\pixmaps\\*.png", |
|
|
"data\\pixmaps\\*.png", |
|
|
"data\\pixmaps\\*.ico", |
|
|
|
|
|
"locale\\*\\LC_MESSAGES\\*.mo" |
|
|
"locale\\*\\LC_MESSAGES\\*.mo" |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
@ -210,7 +213,8 @@ def windows_setup(): |
|
|
windows = [] |
|
|
windows = [] |
|
|
data_files = [] |
|
|
data_files = [] |
|
|
|
|
|
|
|
|
# Py2exe dependencies & options |
|
|
|
|
|
|
|
|
# py2exe dependencies & options |
|
|
|
|
|
# TODO change directory for ffmpeg.exe & ffprobe.exe |
|
|
dependencies = [ |
|
|
dependencies = [ |
|
|
"C:\\Windows\\System32\\ffmpeg.exe", |
|
|
"C:\\Windows\\System32\\ffmpeg.exe", |
|
|
"C:\\Windows\\System32\\ffprobe.exe", |
|
|
"C:\\Windows\\System32\\ffprobe.exe", |
|
@ -224,10 +228,10 @@ def windows_setup(): |
|
|
} |
|
|
} |
|
|
############################################# |
|
|
############################################# |
|
|
|
|
|
|
|
|
# Add package data |
|
|
|
|
|
|
|
|
# Add py2exe deps & pixmaps icons (*.png) |
|
|
data_files.extend([ |
|
|
data_files.extend([ |
|
|
("", dependencies), |
|
|
("", dependencies), |
|
|
("data\\pixmaps", glob.glob("youtube_dl_gui\\data\\pixmaps\\*.*")), |
|
|
|
|
|
|
|
|
("data\\pixmaps", glob.glob("youtube_dl_gui\\data\\pixmaps\\*.png")), |
|
|
]) |
|
|
]) |
|
|
|
|
|
|
|
|
# We have to manually add the translation files since py2exe cant do it |
|
|
# We have to manually add the translation files since py2exe cant do it |
|
@ -257,12 +261,11 @@ def windows_setup(): |
|
|
return normal_setup() |
|
|
return normal_setup() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if os.name == "nt": |
|
|
|
|
|
|
|
|
if on_windows(): |
|
|
params = windows_setup() |
|
|
params = windows_setup() |
|
|
else: |
|
|
else: |
|
|
params = linux_setup() |
|
|
params = linux_setup() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup( |
|
|
setup( |
|
|
author = __author__, |
|
|
author = __author__, |
|
|
name = __appname__, |
|
|
name = __appname__, |
|
|