File tree Expand file tree Collapse file tree 2 files changed +38
-36
lines changed Expand file tree Collapse file tree 2 files changed +38
-36
lines changed Original file line number Diff line number Diff line change 3
3
4
4
block_cipher = None
5
5
6
- script_path = os .path .join (workpath , 'ndrop-script.py' )
6
+ app_name = 'ndrop'
7
+ pkg_path = 'ndrop'
8
+
9
+ script_path = os .path .join (workpath , f'{ app_name } -script.py' )
7
10
8
11
with open (script_path , 'wt' ) as f :
9
- f .write ('import ndrop .__main__\n ndrop .__main__.run()' )
12
+ f .write (f 'import { pkg_path } .__main__\n { pkg_path } .__main__.run()' )
10
13
11
14
a = Analysis ([script_path ],
12
- pathex = [workpath ],
15
+ pathex = ['.' ],
13
16
binaries = [],
14
17
datas = [],
15
18
hiddenimports = ['pkg_resources.py2_warn' ],
@@ -24,35 +27,34 @@ a = Analysis([script_path],
24
27
pyz = PYZ (a .pure , a .zipped_data ,
25
28
cipher = block_cipher )
26
29
27
- # one folder
28
- # exe = EXE(pyz,
29
- # a.scripts,
30
- # [],
31
- # exclude_binaries=True,
32
- # name='ndrop',
33
- # debug=False,
34
- # bootloader_ignore_signals=False,
35
- # strip=False,
36
- # upx=True,
37
- # console=True )
38
- # coll = COLLECT(exe,
39
- # a.binaries,
40
- # a.zipfiles,
41
- # a.datas,
42
- # strip=False,
43
- # upx=True,
44
- # upx_exclude=[],
45
- # name='ndrop')
46
-
47
- # onefile
48
- exe = EXE (pyz ,
49
- a .scripts ,
50
- a .binaries ,
51
- a .zipfiles ,
52
- a .datas ,
53
- name = 'ndrop' ,
54
- debug = False ,
55
- strip = False ,
56
- upx = True ,
57
- runtime_tmpdir = None ,
58
- console = True )
30
+ if False : # one folder
31
+ exe = EXE (pyz ,
32
+ a .scripts ,
33
+ [],
34
+ exclude_binaries = True ,
35
+ name = app_name ,
36
+ debug = False ,
37
+ bootloader_ignore_signals = False ,
38
+ strip = False ,
39
+ upx = True ,
40
+ console = True )
41
+ coll = COLLECT (exe ,
42
+ a .binaries ,
43
+ a .zipfiles ,
44
+ a .datas ,
45
+ strip = False ,
46
+ upx = True ,
47
+ upx_exclude = [],
48
+ name = app_name )
49
+ else : # onefile
50
+ exe = EXE (pyz ,
51
+ a .scripts ,
52
+ a .binaries ,
53
+ a .zipfiles ,
54
+ a .datas ,
55
+ name = app_name ,
56
+ debug = False ,
57
+ strip = False ,
58
+ upx = True ,
59
+ runtime_tmpdir = None ,
60
+ console = True )
Original file line number Diff line number Diff line change 1
1
2
2
rmdir build /s /q
3
- rmdir dist\ndrop /s /q
3
+ del dist\ndrop.exe /q
4
4
pyinstaller ndrop.spec
5
5
6
6
dist\ndrop.exe
You can’t perform that action at this time.
0 commit comments