Skip to content

Commit 2a73053

Browse files
committed
Make spec file more flexible
1 parent 261bff9 commit 2a73053

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

contract_generator_app.spec

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# -*- mode: python ; coding: utf-8 -*-
22

3+
# ------------ Modify here! -------------
4+
app_name = "Contract.app"
5+
project_dir = "/Users/yhh/github-repo/contract-generator-pyside2"
6+
templates_dir = "/Users/yhh/github-repo/contract-generator-pyside2/templates"
7+
font_file_path = "/System/Library/Fonts/Helvetica.ttc"
8+
# ---------------------------------------
39

410
block_cipher = None
511

612
# include files
7-
cairocffi_version_path = ("/opt/miniconda3/envs/contract_generator_pyside2/lib/python3.6/site-packages/cairocffi/VERSION", "cairocffi")
8-
weasyprint_version_path = ("/opt/miniconda3/envs/contract_generator_pyside2/lib/python3.6/site-packages/weasyprint/VERSION", "weasyprint")
9-
pyphen_dir = ("/opt/miniconda3/envs/contract_generator_pyside2/lib/python3.6/site-packages/pyphen/dictionaries", "pyphen/dictionaries")
10-
cairosvg_version_path = ("/opt/miniconda3/envs/contract_generator_pyside2/lib/python3.6/site-packages/cairosvg/VERSION", "cairosvg")
11-
font_path = ("/System/Library/Fonts/Helvetica.ttc", "font")
13+
font_path = (font_file_path, "font")
1214

1315
a = Analysis(['contract_generator.py'],
14-
pathex=['/Users/yhh/github-repo/contract-generator-pyside2'],
16+
pathex=[project_dir],
1517
binaries=[],
16-
datas=[cairocffi_version_path,
17-
weasyprint_version_path,
18-
pyphen_dir,
19-
cairosvg_version_path,
20-
font_path],
18+
datas=[font_path],
2119
hiddenimports=[],
2220
hookspath=[],
2321
runtime_hooks=[],
@@ -28,7 +26,7 @@ a = Analysis(['contract_generator.py'],
2826
noarchive=False)
2927

3028
# include the whole directory
31-
a.datas += Tree("/Users/yhh/github-repo/contract-generator-pyside2/templates", prefix="templates")
29+
a.datas += Tree(templates_dir, prefix="templates")
3230

3331
pyz = PYZ(a.pure, a.zipped_data,
3432
cipher=block_cipher)
@@ -47,6 +45,6 @@ exe = EXE(pyz,
4745
runtime_tmpdir=None,
4846
console=False )
4947
app = BUNDLE(exe,
50-
name='contract_generator.app',
48+
name=app_name,
5149
icon=None,
5250
bundle_identifier=None)

0 commit comments

Comments
 (0)