File: setup.py

package info (click to toggle)
pythoncard 0.8.2-5
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 9,364 kB
  • ctags: 6,988
  • sloc: python: 56,804; makefile: 60; sh: 22
file content (105 lines) | stat: -rwxr-xr-x 3,923 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python
# $Id: setup.py,v 1.22 2004/10/03 18:53:22 kasplat Exp $
# By R.Suzi rnd@onego.ru
# Extended and expanded by Andy Todd <andy47@halfcooked.com>

WIN_DEFAULT_COMMAND = "install"
APPLICATION_NAME = "PythonCard"
from distutils.core import setup
from distutils.command.install_data import install_data
import glob, os, sys
import __version__
if len(sys.argv) == 1 and sys.platform.startswith("win"):
    sys.argv.append(WIN_DEFAULT_COMMAND)

classifiers = """\
Development Status :: 4 - Beta
Environment :: MacOS X
Environment :: MacOS X :: Carbon
Environment :: Win32 (MS Windows)
Environment :: X11 Applications :: GTK
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: End Users/Desktop
Intended Audience :: Information Technology
Intended Audience :: Other Audience
Intended Audience :: Science/Research
Intended Audience :: System Administrators
License :: OSI Approved :: BSD License
Natural Language :: English
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows
Operating System :: POSIX :: Linux
Programming Language :: Python
Topic :: Software Development
Topic :: Software Development :: User Interfaces
"""

longdescription = "PythonCard is a GUI construction kit for building cross-platform " + \
"desktop applications on Windows, Mac OS X, and Linux, using the Python language."

"""
This script is setup.py of the PythonCard package.

You need to have wxPython to run PythonCard
"""

class smart_install_data(install_data):
    def run(self):
        #need to change self.install_dir to the actual library dir
        install_cmd = self.get_finalized_command('install')
        self.install_dir = getattr(install_cmd, 'install_lib')
        return install_data.run(self) 

def recurseDir(startDir):
    # This should all be replaced by calls to os.path.walk, but later
    listX=[startDir]
    for fyle in os.listdir(startDir):
        if fyle != "debian":
            file=os.path.join(startDir,fyle)
            if os.path.isdir(file):
                listX.extend(recurseDir(file))
    return listX

def makeDataDirs(rootDir=APPLICATION_NAME, dataDirs=['.', 'docs','samples', 'tools']):
    "Construct a list of the data directories to be included"
    # This function will return a list of tuples, each tuple being of the form;
    #  ( <target_directory_name>, [<list_of_files>] )
    listX=[]
    results=[]
    for directory in dataDirs:
        directories=recurseDir(directory)
        results.extend(directories)
    for directory in results:
        if os.path.split(directory)[1]!='CVS':
            # Add this directory and its contents to list
            files=[]
            for file in os.listdir(directory):
                if file!='CVS' and file!='.cvsignore':
                    if os.path.isfile(os.path.join(directory, file)):
                        files.append(os.path.join(directory, file))
            listX.append((rootDir+'/'+directory, files))
    # list.append((rootDir, 'stc_styles.cfg'))
        
    return listX

setup(name=APPLICATION_NAME, 
      version=__version__.VERSION_STRING,
      description="PythonCard GUI-builder",
      author="PythonCard Developers",
      author_email="pythoncard-users@lists.sourceforge.net",
      url="http://pythoncard.sourceforge.net/",
      download_url="http://sourceforge.net/project/showfiles.php?group_id=19015",
      classifiers = filter(None, classifiers.split("\n")),
      long_description = longdescription,
      platforms = "Mac OS X, Windows, Linux",
      packages=[APPLICATION_NAME, APPLICATION_NAME + ".components", APPLICATION_NAME + ".templates", APPLICATION_NAME + ".templates.dialogs"],
      package_dir={APPLICATION_NAME: '.'},
      #Removed for Debian
      #scripts=["install-pythoncard.py"],
      license="BSD",
      cmdclass = { 'install_data': smart_install_data},
      data_files=makeDataDirs(),
     )

# End of setup.py