/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-06 14:00:46 UTC
  • mfrom: (727 trunk)
  • mto: This revision was merged to the branch mainline in revision 731.
  • Revision ID: jelmer@samba.org-20110406140046-xa42a1ce8a5bgq7p
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from distutils.core import setup, Command
7
7
from distutils.command.install_data import install_data
8
8
from distutils.command.build import build
 
9
from distutils.command.sdist import sdist
 
10
try:
 
11
    from DistUtilsExtra.command import *
 
12
except ImportError:
 
13
   # Python distutils extra is not available.
 
14
    class cmd_build_i18n(Command):
 
15
        def run(self):
 
16
            print >> sys.stderr, "For internationalization support you'll need to install https://launchpad.net/python-distutils-extra"
 
17
else:
 
18
    # Use build_i18n from DistUtilsExtra
 
19
    cmd_build_i18n = build_i18n.build_i18n
 
20
 
9
21
import os
10
22
import sys
11
23
 
25
37
 
26
38
    def run(self):
27
39
        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
28
 
        import __init__ as bzrgtk
 
40
        from bzrlib.plugin import PluginImporter
 
41
        PluginImporter.specific_paths["bzrlib.plugins.gtk"] = os.path.dirname(__file__)
 
42
        from bzrlib.plugins.gtk.tests import load_tests
 
43
        suite = TestSuite()
 
44
        loader = TestLoader()
 
45
        load_tests(suite, None, loader)
29
46
        runner = TextTestRunner()
30
 
        loader = TestLoader()
31
 
        suite = TestSuite()
32
 
        suite.addTest(bzrgtk.test_suite())
33
47
        result = runner.run(suite)
34
48
        return result.wasSuccessful()
35
49
 
77
91
    sub_commands.append(('build_credits', is_versioned))
78
92
 
79
93
 
 
94
class SourceDist(sdist):
 
95
    sub_commands = sdist.sub_commands[:]
 
96
    sub_commands.append(('build_credits', is_versioned))
 
97
 
 
98
 
80
99
class InstallData(install_data):
81
100
 
82
101
    def run(self):
150
169
                                             'icons/tag-16.png',
151
170
                                             'icons/bug.png',
152
171
                                             'icons/bzr-icon-64.png']),
 
172
                    # In case Python distutils extra is not available,
 
173
                    # install the .desktop files
153
174
                    ('share/applications', ['bazaar-properties.desktop',
154
175
                                            'bzr-handle-patch.desktop',
155
176
                                            'bzr-notify.desktop']),
167
188
        cmdclass={'install_data': InstallData,
168
189
                  'build_credits': CreateCredits,
169
190
                  'build': BuildData,
 
191
                  'build_i18n': cmd_build_i18n,
 
192
                  'sdist': SourceDist,
170
193
                  'check': Check}
171
194
        )