/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: David Planella
  • Date: 2011-03-06 08:24:07 UTC
  • mfrom: (718 trunk)
  • mto: This revision was merged to the branch mainline in revision 719.
  • Revision ID: david.planella@ubuntu.com-20110306082407-y9zwkjje5oue9egw
Added preliminary internationalization support. Merged from 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
9
10
from DistUtilsExtra.command import *
 
11
try:
 
12
    from DistUtilsExtra.command import *
 
13
except ImportError:
 
14
   # Python distutils extra is not available.
 
15
    class cmd_build_i18n(Command):
 
16
        def run(self):
 
17
            print >> sys.stderr, "For internationalization support you'll need to install https://launchpad.net/python-distutils-extra"
 
18
else:
 
19
    # Use build_i18n from DistUtilsExtra
 
20
    cmd_build_i18n = build_i18n.build_i18n
 
21
 
10
22
import os
11
23
import sys
12
24
 
26
38
 
27
39
    def run(self):
28
40
        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
29
 
        import __init__ as bzrgtk
 
41
        from bzrlib.plugin import PluginImporter
 
42
        PluginImporter.specific_paths["bzrlib.plugins.gtk"] = os.path.dirname(__file__)
 
43
        from bzrlib.plugins.gtk.tests import load_tests
 
44
        suite = TestSuite()
 
45
        loader = TestLoader()
 
46
        load_tests(suite, None, loader)
30
47
        runner = TextTestRunner()
31
 
        loader = TestLoader()
32
 
        suite = TestSuite()
33
 
        suite.addTest(bzrgtk.test_suite())
34
48
        result = runner.run(suite)
35
49
        return result.wasSuccessful()
36
50
 
78
92
    sub_commands.append(('build_credits', is_versioned))
79
93
 
80
94
 
 
95
class SourceDist(sdist):
 
96
    sub_commands = sdist.sub_commands[:]
 
97
    sub_commands.append(('build_credits', is_versioned))
 
98
 
 
99
 
81
100
class InstallData(install_data):
82
101
 
83
102
    def run(self):
151
170
                                             'icons/tag-16.png',
152
171
                                             'icons/bug.png',
153
172
                                             'icons/bzr-icon-64.png']),
 
173
                    # In case Python distutils extra is not available,
 
174
                    # install the .desktop files
 
175
                    ('share/applications', ['bazaar-properties.desktop',
 
176
                                            'bzr-handle-patch.desktop',
 
177
                                            'bzr-notify.desktop']),
154
178
                    ('share/application-registry', ['bzr-gtk.applications']),
155
179
                    ('share/pixmaps', ['icons/bzr-icon-64.png']),
 
180
                    ('share/icons/hicolor/scalable/apps', ['icons/bzr-panel.svg']),
156
181
                    ('share/icons/hicolor/scalable/emblems',
157
182
                     ['icons/emblem-bzr-added.svg',
158
183
                      'icons/emblem-bzr-conflict.svg',
164
189
        cmdclass={'install_data': InstallData,
165
190
                  'build_credits': CreateCredits,
166
191
                  'build': BuildData,
167
 
                  'build_i18n': build_i18n.build_i18n,
 
192
                  'build_i18n': cmd_build_i18n,
 
193
                  'sdist': SourceDist,
168
194
                  'check': Check}
169
195
        )