-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·112 lines (107 loc) · 3.93 KB
/
setup.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
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
#!/usr/bin/env python
# encoding: utf-8
import sys, glob
data_files = [
('images', ['images/websniffer.ico']),
('images/toolbar', glob.glob("images/toolbar/*.png")),
('images/menu', glob.glob("images/menu/*.png")),
('locale/zh_CN', glob.glob("locale/zh_CN/*.mo")),
('locale/zh_TW', glob.glob("locale/zh_TW/*.mo")),
('window', glob.glob('window/window.xrc')),
('', glob.glob('*.txt')),
]
include_modules = ['MainFrame', 'RequestTree', 'TextCtrl', 'Preferences']
if sys.platform == 'win32':
from distutils.core import setup
import py2exe
manifest = """
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="x86"
name="Controls"
type="win32"
/>
<description>WebSniffer</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
"""
include_modules.append('dbhash')
setup(
windows=[{
"script": 'WebSniffer.py',
"other_resources": [(24,1,manifest)],
'icon_resources': [(0, 'images/websniffer.ico')]
}],
options = {"py2exe": {"optimize": 2,
"compressed": 1,
'includes': include_modules,
"bundle_files": 1}},
zipfile = None,
name="WebSniffer",
description="The web debug proxy",
version='0.1.5',
author="yinzhigang",
author_email="sxin.net@gmail.com",
data_files = data_files
)
elif sys.platform == 'linux2':
from cx_Freeze import setup, Executable
include_modules.append('dbhash')
setup(
name = "WebSniffer",
version = "0.1.5",
description = "The web debug proxy",
author="yinzhigang",
author_email="sxin.net@gmail.com",
options = dict(
build_exe = dict(includes = include_modules,
packages=['encodings', 'bsddb'],
compressed = True,
optimize = 2,
include_files = [('images', 'images'), ('window', 'window'),
('locale/zh_CN/messages.mo', 'locale/zh_CN/messages.mo'),
('locale/zh_TW/messages.mo', 'locale/zh_TW/messages.mo'),
('readme.txt', 'readme.txt'),
('license.txt', 'license.txt'),
('Changelog.txt', 'Changelog.txt'),
],
),
),
executables = [Executable("WebSniffer.py", copyDependentFiles=True)]
)
elif sys.platform == 'darwin':
from distutils.core import setup
import py2app
setup(
options=dict(
py2app=dict(
iconfile='images/websniffer.icns',
optimize = 2,
includes = include_modules,
#resources=['resources/License.txt'],
plist=dict(
CFBundleName = "WebSniffer",
CFBundleShortVersionString = "0.1.5", # must be in X.X.X format
CFBundleGetInfoString = "WebSniffer 0.1.5",
CFBundleExecutable = "WebSniffer",
CFBundleIdentifier = "cn.websniffer.WebSniffer",
),
),
),
data_files = data_files,
app=[ 'WebSniffer.py' ]
)