/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:
1
1
#!/usr/bin/python
2
2
"""GTK+ Frontends for various Bazaar commands."""
3
3
 
4
 
import os
5
 
import sys
6
 
 
7
 
from info import bzr_plugin_version
 
4
from info import *
8
5
 
9
6
from distutils.core import setup, Command
10
7
from distutils.command.install_data import install_data
11
8
from distutils.command.build import build
12
9
from distutils.command.sdist import sdist
 
10
from DistUtilsExtra.command import *
13
11
try:
14
 
    from DistUtilsExtra.command import build_i18n
 
12
    from DistUtilsExtra.command import *
15
13
except ImportError:
16
 
    # Python distutils extra is not available.
17
 
    class cmd_build_i18n(build):
18
 
        user_options = []
19
 
 
20
 
        def initialize_options(self):
21
 
            self.domain = None
22
 
            self.desktop_files = None
23
 
 
24
 
        def finalize_options(self):
25
 
            pass
26
 
 
 
14
   # Python distutils extra is not available.
 
15
    class cmd_build_i18n(Command):
27
16
        def run(self):
28
 
            print >> sys.stderr, (
29
 
                "For internationalization support you'll need to install "
30
 
                "https://launchpad.net/python-distutils-extra")
 
17
            print >> sys.stderr, "For internationalization support you'll need to install https://launchpad.net/python-distutils-extra"
31
18
else:
32
19
    # Use build_i18n from DistUtilsExtra
33
20
    cmd_build_i18n = build_i18n.build_i18n
34
21
 
 
22
import os
 
23
import sys
35
24
 
36
25
class Check(Command):
37
26
    description = "Run unit tests"
38
27
 
39
 
    user_options = [
40
 
        ('module=', 'm', 'The test module to run'),
41
 
        ]
 
28
    user_options = []
42
29
 
43
30
    def initialize_options(self):
44
 
        self.module = None
 
31
        pass
45
32
 
46
33
    def finalize_options(self):
47
34
        pass
52
39
    def run(self):
53
40
        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
54
41
        from bzrlib.plugin import PluginImporter
55
 
        PluginImporter.specific_paths["bzrlib.plugins.gtk"] = os.path.dirname(
56
 
            __file__)
 
42
        PluginImporter.specific_paths["bzrlib.plugins.gtk"] = os.path.dirname(__file__)
57
43
        from bzrlib.plugins.gtk.tests import load_tests
58
44
        suite = TestSuite()
59
45
        loader = TestLoader()
60
 
        load_tests(suite, self.module, loader)
 
46
        load_tests(suite, None, loader)
61
47
        runner = TextTestRunner()
62
48
        result = runner.run(suite)
63
49
        return result.wasSuccessful()
78
64
        return 'build_credits'
79
65
 
80
66
    def run(self):
81
 
        from bzrlib.plugin import load_plugins
82
 
        load_plugins()
 
67
        from bzrlib.plugin import load_plugins; load_plugins()
83
68
        from bzrlib.branch import Branch
84
69
        from bzrlib.plugins.stats.cmds import find_credits
85
70
 
142
127
    version = bzr_plugin_version[:3]
143
128
    version_string = ".".join([str(x) for x in version])
144
129
    setup(
145
 
        name="bzr-gtk",
146
 
        version=version_string,
147
 
        maintainer="Jelmer Vernooij",
148
 
        maintainer_email="jelmer@samba.org",
149
 
        description="GTK+ Frontends for various Bazaar commands",
150
 
        license="GNU GPL v2 or later",
151
 
        scripts=['bzr-handle-patch'],
152
 
        url="http://bazaar-vcs.org/BzrGtk",
153
 
        package_dir={
 
130
        name = "bzr-gtk",
 
131
        version = version_string,
 
132
        maintainer = "Jelmer Vernooij",
 
133
        maintainer_email = "jelmer@samba.org",
 
134
        description = "GTK+ Frontends for various Bazaar commands",
 
135
        license = "GNU GPL v2 or later",
 
136
        scripts = ['bzr-handle-patch', 'bzr-notify'],
 
137
        url = "http://bazaar-vcs.org/BzrGtk",
 
138
        package_dir = {
154
139
            "bzrlib.plugins.gtk": ".",
155
140
            "bzrlib.plugins.gtk.viz": "viz",
156
141
            "bzrlib.plugins.gtk.annotate": "annotate",
158
143
            "bzrlib.plugins.gtk.branchview": "branchview",
159
144
            "bzrlib.plugins.gtk.preferences": "preferences",
160
145
            },
161
 
        packages=[
 
146
        packages = [
162
147
            "bzrlib.plugins.gtk",
163
148
            "bzrlib.plugins.gtk.viz",
164
149
            "bzrlib.plugins.gtk.annotate",
166
151
            "bzrlib.plugins.gtk.branchview",
167
152
            "bzrlib.plugins.gtk.preferences",
168
153
        ],
169
 
        data_files=[('share/bzr-gtk', ['credits.pickle']),
 
154
        data_files=[ ('share/bzr-gtk', ['credits.pickle']),
170
155
                    ('share/bzr-gtk/icons', ['icons/commit.png',
171
156
                                             'icons/commit16.png',
172
157
                                             'icons/diff.png',
188
173
                    # In case Python distutils extra is not available,
189
174
                    # install the .desktop files
190
175
                    ('share/applications', ['bazaar-properties.desktop',
191
 
                                            'bzr-handle-patch.desktop']),
 
176
                                            'bzr-handle-patch.desktop',
 
177
                                            'bzr-notify.desktop']),
192
178
                    ('share/application-registry', ['bzr-gtk.applications']),
193
179
                    ('share/pixmaps', ['icons/bzr-icon-64.png']),
194
 
                    ('share/icons/hicolor/scalable/apps',
195
 
                        ['icons/bzr-panel.svg']),
 
180
                    ('share/icons/hicolor/scalable/apps', ['icons/bzr-panel.svg']),
196
181
                    ('share/icons/hicolor/scalable/emblems',
197
182
                     ['icons/emblem-bzr-added.svg',
198
183
                      'icons/emblem-bzr-conflict.svg',