forked from leo-editor/leo-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchLeo-folder.spec
More file actions
184 lines (169 loc) · 6.05 KB
/
launchLeo-folder.spec
File metadata and controls
184 lines (169 loc) · 6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# -*- mode: python -*-
'''
launchLeo-folder.spec: a spec file for pyinstaller that creates a folder-based install of Leo.
Run with pyinstaller launchLeo-folder.spec, **not** with launchLeo.py.
'''
block_cipher = None
import glob, os, sys
# Same code as in runLeo.py.
path = os.getcwd()
if path not in sys.path:
print('launchLeo.spec: appending %s to sys.path' % path)
sys.path.append(path)
import leo.core.leoGlobals as g
import leo.core.leoApp as leoApp
LM = leoApp.LoadManager()
loadDir = LM.computeLoadDir()
def get_modules(name):
'''return a list of module names in the leo/name directory.'''
# abs_dir = os.path.abspath(os.path.join(r'C:\leo.repo\leo-editor\leo', name))
abs_dir = g.os_path_finalize_join(loadDir, '..', name)
n = len(abs_dir) + 1
aList = glob.glob(abs_dir + '/*.py')
return ['leo.%s.%s' % (name, z[n:][: -3]) for z in aList]
hiddenimports = []
for name in ('external', 'modes', 'plugins'):
hiddenimports.extend(get_modules(name))
# Utilities for creating entries in the "datas" lists...
def all(name):
'''Return a tuple that causes all files in name to be included.'''
return ('%s/*.*' % (name), name)
icons = all
def ext(kind, name):
'''Return a tuple that causes all files with the given extension in name to be included.'''
if kind.startswith('.'):
kind = kind[1:]
return ('%s/*.%s' % (name, kind), name)
datas = [
# Required for startup...
('leo/core/commit_timestamp.json', 'leo/core'),
ext('.ui', 'leo/plugins'),
# Required for plugins...
# Data requifed for startup.
all('leo/plugins/GraphCanvas'),
# These are also hidden imports...
ext('.py', 'leo/plugins'),
ext('.py', 'leo/plugins/importers'),
ext('.py', 'leo/plugins/writers'),
# leo/config...
ext('.leo', 'leo/config'),
# leo/modes...
ext('.py', 'leo/modes'),
ext('.xml', 'leo/modes'),
# All icons...
icons('leo/Icons'),
icons('leo/Icons/cleo'),
icons('leo/Icons/cleo/small'),
icons('leo/Icons/file_icons'),
icons('leo/Icons/nodes-dark/plusminus'),
icons('leo/Icons/nodes-dark/triangles'),
icons('leo/Icons/recorder'),
icons('leo/themes/generic/Icons'),
icons('leo/themes/leo_dark_0/Icons'),
icons('leo/themes/leo_dark_0/Icons/cleo'),
icons('leo/themes/leo_dark_0/Icons/cleo/small'),
icons('leo/themes/leo_dark_0/Icons/file_icons'),
icons('leo/themes/leo_dark_0/Icons/Tango/16x16/apps'),
# Additional Leo data fles...
# leo-editor: loaded by LeoPy.leo...
('launchLeo-folder.spec', ''),
('launchLeo-single.spec', ''),
('leo_to_html.xsl', ''),
('pylint-leo.py', ''),
('setup.py', ''),
# leo.commands...
ext('.py', 'leo/commands'),
# leo.core...
# Only include reference files.
# ext('.leo', 'leo/core'),
('leo/core/LeoPyRef.leo', 'leo/core'),
ext('.py', 'leo/core'),
ext('.txt', 'leo/core'),
# leo.dist...
all('leo/dist'),
# leo/doc & leo/doc/html
ext('.css', 'leo/doc'),
ext('.js', 'leo/doc'),
ext('.html', 'leo/doc'),
ext('.leo', 'leo/doc'),
ext('.py', 'leo/doc'),
ext('.txt', 'leo/doc'),
all('leo/doc/html'),
# ext('.jif','leo/doc/html'),
# ext('.py','leo/doc/html'),
# ext('.txt','leo/doc/html'),
# User-selectable icons.
icons('leo/Icons/Tango/16x16/actions'),
icons('leo/Icons/Tango/16x16/animations'),
icons('leo/Icons/Tango/16x16/apps'),
icons('leo/Icons/Tango/16x16/categories'),
icons('leo/Icons/Tango/16x16/devices'),
icons('leo/Icons/Tango/16x16/emblems'),
icons('leo/Icons/Tango/16x16/emotes'),
icons('leo/Icons/Tango/16x16/mimetypes'),
icons('leo/Icons/Tango/16x16/places'),
icons('leo/Icons/Tango/16x16/status'),
# leo/extensions...
ext('.py', 'leo/extensions'),
all('leo/extensions/hooks'),
# leo/external...
ext('.leo', 'leo/external'),
ext('.py', 'leo/external'),
ext('.txt', 'leo/external'),
ext('.css', 'leo/external/ckeditor'),
ext('.js', 'leo/external/ckeditor'),
ext('.json', 'leo/external/ckeditor'),
ext('.md', 'leo/external/ckeditor'),
# leo/plugins...
# Only include reference files.
# ext('.leo', 'leo/plugins'),
('leo/plugins/leoPluginsRef.leo', 'leo/plugins'),
('leo/plugins/leoGuiPluginsRef.leo', 'leo/plugins'),
ext('.txt', 'leo/plugins'),
ext('.py', 'leo/plugins/examples'),
ext('.py', 'leo/plugins/test'),
# leo/scripts...
ext('.bat', 'leo/scripts'),
ext('.leo', 'leo/scripts'),
ext('.txt', 'leo/scripts'),
ext('.py', 'leo/scripts'),
# Everything required for unit tests...
# The leo/test folder itself is required for
# the execute-script command.
ext('.leo', 'leo/test'),
ext('.py', 'leo/test'),
ext('.txt', 'leo/test'),
all('leo/test/unittest'),
all('leo/test/unittest/input'),
all('leo/test/unittest/output'),
# leo/www...
all('leo/www'),
]
a = Analysis(
['launchLeo.py'],
pathex=[], ###'c:\\leo.repo\\leo-editor'],
binaries=None,
datas=datas,
hiddenimports=hiddenimports,
hookspath=None,
runtime_hooks=None,
excludes=['_tkinter',],
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='leo',
debug=False,
strip=None,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='Leo')