|
| 1 | +# -*- mode: python -*- |
| 2 | +a = Analysis(['talkshow.py'], |
| 3 | + pathex=['.'], |
| 4 | + hiddenimports=[], |
| 5 | + hookspath=None, |
| 6 | + runtime_hooks=None) |
| 7 | + |
| 8 | + |
| 9 | +def Datafiles(*filenames, **kw): |
| 10 | + import os |
| 11 | + |
| 12 | + def datafile(path, strip_path=True): |
| 13 | + parts = path.split('/') |
| 14 | + path = name = os.path.join(*parts) |
| 15 | + if strip_path: |
| 16 | + name = os.path.basename(path) |
| 17 | + return name, path, 'DATA' |
| 18 | + |
| 19 | + strip_path = kw.get('strip_path', True) |
| 20 | + return TOC( |
| 21 | + datafile(filename, strip_path=strip_path) |
| 22 | + for filename in filenames |
| 23 | + if os.path.isfile(filename)) |
| 24 | + |
| 25 | +def DataDir(directoryname, **kw): |
| 26 | + ''' recursively collect and add all files under a certain directory''' |
| 27 | + |
| 28 | + return data_files |
| 29 | + |
| 30 | +import os |
| 31 | +data_list = [] |
| 32 | +for dirname, dirnames, filenames in os.walk('plugins'): |
| 33 | + for filename in filenames: |
| 34 | + data_list.append(os.path.join(dirname, filename)) |
| 35 | +vlc_plugins = Datafiles(*data_list, strip_path=False) |
| 36 | + |
| 37 | + |
| 38 | +data_list = [] |
| 39 | +for dirname, dirnames, filenames in os.walk('style'): |
| 40 | + for filename in filenames: |
| 41 | + data_list.append(os.path.join(dirname, filename)) |
| 42 | +style = Datafiles(*data_list, strip_path=False) |
| 43 | + |
| 44 | + |
| 45 | +data_list = [] |
| 46 | +for dirname, dirnames, filenames in os.walk('alarm'): |
| 47 | + for filename in filenames: |
| 48 | + data_list.append(os.path.join(dirname, filename)) |
| 49 | +alarm = Datafiles(*data_list, strip_path=False) |
| 50 | + |
| 51 | + |
| 52 | +# add static files |
| 53 | +other_data_files = Datafiles('README.md') |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +pyz = PYZ(a.pure) |
| 58 | +exe = EXE(pyz, |
| 59 | + a.scripts, |
| 60 | + exclude_binaries=True, |
| 61 | + name='talkshow.exe', |
| 62 | + debug=False, |
| 63 | + strip=None, |
| 64 | + upx=True, |
| 65 | + console=True ) |
| 66 | +coll = COLLECT(exe, |
| 67 | + a.binaries, |
| 68 | + a.zipfiles, |
| 69 | + a.datas, |
| 70 | + vlc_plugins, |
| 71 | + style, |
| 72 | + alarm, |
| 73 | + other_data_files, |
| 74 | + strip=None, |
| 75 | + upx=True, |
| 76 | + name='talkshow') |
0 commit comments