From 593452ed63b59de1761a85b17d8daf8bef2b8d51 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 29 Oct 2010 10:11:40 +0100 Subject: [PATCH] update bbfreeze script --- win32/deluge-bbfreeze.py | 52 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/win32/deluge-bbfreeze.py b/win32/deluge-bbfreeze.py index b7c4c75ad..8a5040357 100644 --- a/win32/deluge-bbfreeze.py +++ b/win32/deluge-bbfreeze.py @@ -1,19 +1,37 @@ -build_version = "1.2.2" -python_path = "C:\\Python26\\" - -import shutil -shutil.copy(python_path + "Scripts\deluge-script.py", python_path + "Scripts\deluge.py") -shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged.py") -shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web.py") -shutil.copy(python_path + "Scripts\deluge-gtk-script.py", python_path + "Scripts\deluge-gtk.py") -shutil.copy(python_path + "Scripts\deluge-console-script.py", python_path + "Scripts\deluge-console.py") +build_version = "1.3.1" +python_path = "C:\\Python26\\" - -from bbfreeze import Freezer -f = Freezer("..\\build-win32\\deluge-bbfreeze-" + build_version, includes=("libtorrent", "gzip", "zipfile", "re", "socket", "struct", "cairo", "pangocairo", "atk", "pango", "wsgiref.handlers", "twisted.internet.utils", "gio", "gtk.glade")) -f.addScript(python_path + "Scripts\deluge.py", gui_only=False) -f.addScript(python_path + "Scripts\deluged.py", gui_only=False) -f.addScript(python_path + "Scripts\deluge-web.py", gui_only=False) -f.addScript(python_path + "Scripts\deluge-gtk.py", gui_only=False) -f.addScript(python_path + "Scripts\deluge-console.py", gui_only=False) +import shutil +shutil.copy(python_path + "Scripts\deluge-script.py", python_path + "Scripts\deluge.py") +shutil.copy(python_path + "Scripts\deluged-script.py", python_path + "Scripts\deluged.py") +shutil.copy(python_path + "Scripts\deluge-web-script.py", python_path + "Scripts\deluge-web.py") +shutil.copy(python_path + "Scripts\deluge-gtk-script.py", python_path + "Scripts\deluge-gtk.py") +shutil.copy(python_path + "Scripts\deluge-console-script.py", python_path + "Scripts\deluge-console.py") + + +from bbfreeze import Freezer +f = Freezer("..\\build-win32\\deluge-bbfreeze-" + build_version, includes=("libtorrent", "gzip", "zipfile", "re", "socket", "struct", "cairo", "pangocairo", "atk", "pango", "wsgiref.handlers", "twisted.internet.utils", "gio", "gtk.glade")) +f.addScript(python_path + "Scripts\deluge.py", gui_only=False) +f.addScript(python_path + "Scripts\deluged.py", gui_only=False) +f.addScript(python_path + "Scripts\deluge-web.py", gui_only=False) +f.addScript(python_path + "Scripts\deluge-gtk.py", gui_only=False) +f.addScript(python_path + "Scripts\deluge-console.py", gui_only=False) f() # starts the freezing process + +# add icons to the exe files +import icon + +icon_path = os.path.join(os.path.dirname(__file__), "deluge.ico") +icon.CopyIcons(dst+"deluge.exe", icon_path) +icon.CopyIcons(dst+"deluge-debug.exe", icon_path) +icon.CopyIcons(dst+"deluged.exe", icon_path) +icon.CopyIcons(dst+"deluge-web.exe", icon_path) +icon.CopyIcons(dst+"deluge-gtk.exe", icon_path) +icon.CopyIcons(dst+"deluge-console.exe", icon_path) + +# exclude files which are already included in GTK or Windows +excludeFiles = ("MSIMG32.dll", "MSVCR90.dll", "MSVCP90.dll", "POWRPROF.dll", "freetype*.dll", "iconv.dll", "intl.dll", "libatk*.dll", "libcairo*.dll", "libexpat*.dll", "libfontconfig*.dll", "libfreetype*.dll", "libgio*.dll", "libpng*.dll", "libtiff*.dll", "zlib1.dll") +for file in excludeFiles: + for filename in glob.glob(dst + file): + print "removing file:", filename + os.remove(filename)