-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildWindows.py
executable file
·43 lines (39 loc) · 1.69 KB
/
buildWindows.py
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
from distutils.core import setup
import py2exe
import os
import glob
def find_data_files(source,target,patterns):
"""Locates the specified data-files and returns the matches
in a data_files compatible format.
source is the root of the source data tree.
Use '' or '.' for current directory.
target is the root of the target data tree.
Use '' or '.' for the distribution directory.
patterns is a sequence of glob-patterns for the
files you want to copy.
"""
if glob.has_magic(source) or glob.has_magic(target):
raise ValueError("Magic not allowed in src, target")
ret = {}
for pattern in patterns:
pattern = os.path.join(source,pattern)
for filename in glob.glob(pattern):
if os.path.isfile(filename):
targetpath = os.path.join(target,os.path.relpath(filename,source))
path = os.path.dirname(targetpath)
ret.setdefault(path,[]).append(filename)
return sorted(ret.items())
setup(name="Spreader",
version="1.4.3",
author="Thomas Liu",
author_email="[email protected]",
url="https://tfliu.com",
license="GNU General Public License (GPL)",
scripts=["cards_server.py","cards_gui_client.py","cards_client.py"],
console=["cards_server.py","cards_client.py"],
windows=[{"script": "cards_gui_client.py", "icon_resources": [(1, "spreader.ico")]}],
data_files=find_data_files('.','',[
'img/*','LICENSE.','README.md','settings.ini', 'CHANGELOG', 'cardsAgainstHumanity-black.txt', 'cardsAgainstHumanity-white.txt','test-adjs.txt','test-nouns.txt'
]),
options={"py2exe": {"includes": ["sip"]}})