]> git.zarvox.org Git - wp3.git/blob - setup.py
Added Python docstrings for all classes.
[wp3.git] / setup.py
1 # This is a DistUtils setup script to be used with py2exe, a DistUtils extension.
2 #
3 # To create the redistributable package, run:
4 # python setup.py py2exe
5 #
6 # You may need to change the following line to accurately show the location of
7 # your PyQt4 plugins folder:
8 plugins_base = "C:\\Python26\\Lib\\site-packages\\PyQt4\\plugins"
9
10 from py2exe.build_exe import py2exe
11 from distutils.core import setup
12 import os
13
14 # We need the sqlite3 SQL driver, implemented as a plugin
15 sqldrivers_files = [plugins_base + "\\sqldrivers\\qsqlite4.dll"]
16
17 # We need the JPG image format plugin, but we might as well grab them all
18 imageformats_files = []
19 image_base = plugins_base + "\\imageformats\\"
20 for f in os.listdir(image_base):
21         p = image_base + f
22         if os.path.isfile(p): # skip directories
23                 imageformats_files.append(p)
24
25 # Invoke the distutils setup command with appropriate options
26 setup(
27         options = {
28                 "py2exe": {
29                         # 1 or 2 (packing libs into the .exe) seem to have massive issues with image format plugin loading
30                         "bundle_files": 3,
31                         # We declare these here, otherwise they don't get pulled in (and are needed at runtime)
32                         "includes": ["sip","PyQt4.QtSql"]
33                 }
34         },
35         console = [{"script": "mainapp.py"}],
36         zipfile = None,
37         data_files = [
38                 ("", ["README","LICENSE"]),
39                 ("sqldrivers", sqldrivers_files),
40                 ("imageformats", imageformats_files)
41         ]
42 )
43