py2app_mpkg.py :  » Development » PyObjC » trunk » pyobjc » py2app » setup-lib » 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 » Development » PyObjC 
PyObjC » trunk » pyobjc » py2app » setup lib » py2app_mpkg.py
import os
import sys
import setuptools
from py2app.util import skipjunk

_bdist_mpkg = setuptools.Distribution().get_command_class('bdist_mpkg')
class bdist_mpkg(_bdist_mpkg):
    def initialize_options(self):
        _bdist_mpkg.initialize_options(self)
        self.scheme_descriptions['tools'] = u'(Optional) py2app tools'
        self.scheme_map['tools'] = '/Developer/Applications/Python Tools/py2app'

        self.scheme_descriptions['examples'] = u'(Optional) py2app example code'
        self.scheme_map['examples'] = '/Developer/Python/py2app/Examples'
        self.scheme_copy['examples'] = 'examples'

        self.scheme_descriptions['doc'] = u'(Optional) py2app documentation'
        self.scheme_map['doc'] = '/Developer/Python/py2app/Documentation'
        self.scheme_copy['doc'] = 'doc'

    def run_extra(self):
        self.py2app_tools()

    def copy_tree(self, *args, **kw):
        if kw.get('condition') is None:
            kw['condition'] = skipjunk
        return _bdist_mpkg.copy_tree(self, *args, **kw)

    def py2app_tools(self):
        scheme = 'tools'
        source = 'tools'
        schemedir = os.path.abspath(self.get_scheme_install_target(scheme))
        builddir = os.path.abspath(os.path.join(self.bdist_base, scheme))
        for root, dirs, files in os.walk(source):
            if '.svn' in dirs:
                dirs.remove('.svn')
            if 'setup.py' not in files:
                continue
            setupfile = os.path.abspath(os.path.join(root, 'setup.py'))
            tool = os.path.basename(os.path.dirname(setupfile))
            args = [
                'py2app', '--strip', '--dist-dir=' + schemedir,
                '--bdist-base=' + os.path.join(builddir, tool)
            ]
            self.sub_setup(setupfile, args)

cmdclass = {'bdist_mpkg': bdist_mpkg}
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.