setup.py :  » Game-2D-3D » MayaVi » MayaVi-1.5 » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Game 2D 3D » MayaVi 
MayaVi » MayaVi 1.5 » setup.py
#!/usr/bin/env python

""" setup.py for building and installing MayaVi """

__author__ = "Prabhu Ramachandran <prabhu_r@users.sf.net>"
__version__ = "$Revision: 1.11 $"
__date__ = "$Date: 2005/08/25 10:32:10 $"
__credits__ = """Many thanks to Pearu Peterson <pearu@cens.ioc.ee> 
for helping with this setup.py and helping with packaging MayaVi."""

from __version__ import version
import glob, sys, os
import os.path
from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install_scripts import install_scripts

try:
    import py2exe
except ImportError:
    pass

# This class has been copied from scipy's setup.py and is useful to
# install the data files inside the project directory rather than some
# arbitrary place.
class my_install_data (install_data):
    def finalize_options (self):
        self.set_undefined_options ('install',
                                    ('install_lib', 'install_dir'),
                                    ('root', 'root'),
                                    ('force', 'force'),
                                    )


# This renames the mayavi script to a MayaVi.pyw script on win32.
class my_install_scripts (install_scripts):
    def run (self):
        install_scripts.run (self)
        if os.name != 'posix':
            # Rename <script> to <script>.pyw. Executable bits
            # are already set in install_scripts.run().
            for file in self.get_outputs ():
                if file[-4:] != '.pyw':
                    if file == 'mayavi':
                        new_file = file[:-6] + 'MayaVi.pyw'
                    else:
                        new_file = os.path.splitext(file)[0] + '.pyw'
                    self.announce("renaming %s to %s" % (file, new_file))
                    if not self.dry_run:
                        if os.path.exists(new_file):
                            os.remove (new_file)
                        os.rename (file, new_file)

# make docs if necessary.  This will most probably work only for Prabhu.
if 'sdist' in sys.argv:
    os.system ('cd doc/guide && make all')
    

setup (name              = "MayaVi",
       version           = version,
       description       = "The MayaVi Data Visualizer",
       author            = "Prabhu Ramachandran",
       author_email      = "prabhu_r@users.sf.net",
       license           = "BSD",
       long_description  = "A powerful scientific data visualizer for "\
                           "Python",
       keywords          = "scientific data visualization, VTK, graphics",
       url               = "http://mayavi.sourceforge.net",
       platforms         = ['Any'],

       cmdclass          = {'install_data': my_install_data,
                            'install_scripts': my_install_scripts},

       packages          = ['mayavi', 'mayavi.Base', 'mayavi.Filters',
                            'mayavi.Misc', 'mayavi.Modules',
                            'mayavi.Sources', 'mayavi.tools',
                            'vtkPipeline' ],
       package_dir       = {'mayavi': '.'},
       scripts           = ['mayavi', 'doc/vtk_doc.py'],
       data_files        = [('vtkPipeline/Icons',
                             glob.glob('vtkPipeline/Icons/*.gif'))]
       )
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.