forked from dmnfarrell/tkintertable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfreeze.py
More file actions
43 lines (33 loc) · 1.16 KB
/
freeze.py
File metadata and controls
43 lines (33 loc) · 1.16 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
#!/usr/bin/env python
#bbfreeze setup file for tkintertable sample app distribution on Windows
#Damien Farrell, #Mar 2012
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbfreeze/
"""
from bbfreeze import Freezer
import sys, os, shutil
shutil.rmtree('tkintertableapp', ignore_errors=True)
path=os.path.abspath('../')
version = '1.3.1'
f = Freezer('tkintertableapp', excludes=('wx'))
f.addScript(os.path.join(path, "TablesApp.py"))
m=f.mf
f() # runs the freezing process
#mpl data
import matplotlib
mpldir = matplotlib.get_data_path()
datadir = 'tkintertableapp/mpl-data'
shutil.copytree(mpldir, datadir)
#add resource files
shutil.copy('logo.ico', 'tkintertableapp')
shutil.copy('../sample.table', 'tkintertableapp')
#make zip archive
import zipfile
f = zipfile.ZipFile("tkintertableapp-"+version+".zip", "w")
for dirpath, dirnames, filenames in os.walk('tkintertableapp'):
for fname in filenames:
fullname = os.path.join(dirpath, fname)
f.write(fullname)
f.close()