# -*- mode: python ; coding: utf-8 -*- from PyInstaller.utils.hooks import collect_all, copy_metadata import PyInstaller.config import glob import shutil PyInstaller.config.CONF['distpath'] = "freeze" PyInstaller.config.CONF['noconfirm'] = True for pth in (PyInstaller.config.CONF['cachedir'], workpath): if os.path.exists(pth): for f in glob.glob(pth + '/*'): if os.path.isdir(f): shutil.rmtree(f) else: os.remove(f) datas = [] binaries = [] hiddenimports = ['deluge'] tmp_ret = collect_all('deluge') datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] datas += copy_metadata('deluge', recursive=True) datas += copy_metadata('service-identity', recursive=True) excludes = ['share\\icons\\Adwaita\\8', 'share\\icons\\Adwaita\\16', 'share\\icons\\Adwaita\\22', 'share\\icons\\Adwaita\\24', 'share\\icons\\Adwaita\\32', 'share\\icons\\Adwaita\\48', 'share\\icons\\Adwaita\\64', 'share\\icons\\Adwaita\\96', 'share\\icons\\Adwaita\\256', 'share\\icons\\Adwaita\\512', 'share\\icons\\Adwaita\\cursors', 'share\\icons\\Adwaita\\scalable-up'] block_cipher = None a = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-console-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: a.datas = [x for x in a.datas if y not in x[0]] pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, [], exclude_binaries=True, name='deluge-console', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=True, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) b = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-gtk-script.pyw'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: b.datas = [x for x in b.datas if y not in x[0]] pyzb = PYZ(b.pure, b.zipped_data, cipher=block_cipher) exeb = EXE(pyzb, b.scripts, [], exclude_binaries=True, name='deluge-gtk', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=False, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) c = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluged-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: c.datas = [x for x in c.datas if y not in x[0]] pyzc = PYZ(c.pure, c.zipped_data, cipher=block_cipher) exec = EXE(pyzc, c.scripts, [], exclude_binaries=True, name='deluged', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=False, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) d = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluged-debug-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: d.datas = [x for x in d.datas if y not in x[0]] pyzd = PYZ(d.pure, d.zipped_data, cipher=block_cipher) exed = EXE(pyzd, d.scripts, [], exclude_binaries=True, name='deluged-debug', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=True, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) e = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-debug-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: e.datas = [x for x in e.datas if y not in x[0]] pyze = PYZ(e.pure, e.zipped_data, cipher=block_cipher) exee = EXE(pyze, e.scripts, [], exclude_binaries=True, name='deluge-debug', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=True, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) f = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-script.pyw'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: f.datas = [x for x in f.datas if y not in x[0]] pyzf = PYZ(f.pure, f.zipped_data, cipher=block_cipher) exef = EXE(pyzf, f.scripts, [], exclude_binaries=True, name='deluge', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=False, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) g = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-web-debug-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: g.datas = [x for x in g.datas if y not in x[0]] pyzg = PYZ(g.pure, g.zipped_data, cipher=block_cipher) exeg = EXE(pyzg, g.scripts, [], exclude_binaries=True, name='deluge-web-debug', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=True, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) h = Analysis([os.path.abspath(os.path.join(HOMEPATH,os.pardir,os.pardir)) + '\Scripts\deluge-web-script.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) for y in excludes: h.datas = [x for x in h.datas if y not in x[0]] pyzh = PYZ(h.pure, h.zipped_data, cipher=block_cipher) exeh = EXE(pyzh, h.scripts, [], exclude_binaries=True, name='deluge-web', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, icon='../../deluge/ui/data/pixmaps/deluge.ico', console=False, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None ) coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, exeb, b.binaries, b.zipfiles, b.datas, exec, c.binaries, c.zipfiles, c.datas, exed, d.binaries, d.zipfiles, d.datas, exee, e.binaries, e.zipfiles, e.datas, exef, f.binaries, f.zipfiles, f.datas, exeg, g.binaries, g.zipfiles, g.datas, exeh, h.binaries, h.zipfiles, h.datas, strip=False, upx=True, upx_exclude=[], name='deluge')