/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: 2010-05-25 17:09:02 UTC
  • mto: This revision was merged to the branch mainline in revision 691.
  • Revision ID: jelmer@samba.org-20100525170902-3to8g5iw7ovw79kh
Split out olive into a separate directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from distutils.core import setup, Command
6
6
from distutils.command.install_data import install_data
7
7
from distutils.command.build import build
8
 
from distutils.dep_util import newer
9
 
from distutils.log import info
10
 
import glob
11
8
import os
12
9
import sys
13
10
 
83
80
 
84
81
    def run(self):
85
82
        import subprocess
86
 
        self.data_files.extend(self._compile_po_files())
87
83
        self.data_files.extend(self._nautilus_plugin())
88
84
        install_data.run(self)
89
85
 
93
89
        except OSError:
94
90
            pass
95
91
 
96
 
    def _compile_po_files(self):
97
 
        data_files = []
98
 
 
99
 
        # Don't install language files on Win32
100
 
        if sys.platform == 'win32':
101
 
            return data_files
102
 
 
103
 
        PO_DIR = 'po'
104
 
        for po in glob.glob(os.path.join(PO_DIR,'*.po')):
105
 
            lang = os.path.basename(po[:-3])
106
 
            # It's necessary to compile in this directory (not in po_dir)
107
 
            # because install_data can't rename file
108
 
            mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
109
 
 
110
 
            directory = os.path.dirname(mo)
111
 
            if not os.path.exists(directory):
112
 
                info('creating %s' % directory)
113
 
                os.makedirs(directory)
114
 
            if newer(po, mo):
115
 
                # True if mo doesn't exist
116
 
                cmd = 'msgfmt -o %s %s' % (mo, po)
117
 
                info('compiling %s -> %s' % (po, mo))
118
 
                if os.system(cmd) != 0:
119
 
                    raise SystemExit('Error while running msgfmt')
120
 
                dest = os.path.dirname(
121
 
                    os.path.join('share', 'locale', lang,
122
 
                                 'LC_MESSAGES', 'olive-gtk.mo'))
123
 
                data_files.append((dest, [mo]))
124
 
        return data_files
125
 
 
126
92
    def _nautilus_plugin(self):
127
93
        files = []
128
94
        if sys.platform[:5] == 'linux':
144
110
        maintainer_email = "jelmer@samba.org",
145
111
        description = "GTK+ Frontends for various Bazaar commands",
146
112
        license = "GNU GPL v2 or later",
147
 
        scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
 
113
        scripts = ['bzr-handle-patch', 'bzr-notify'],
148
114
        url = "http://bazaar-vcs.org/BzrGtk",
149
115
        package_dir = {
150
116
            "bzrlib.plugins.gtk": ".",
151
117
            "bzrlib.plugins.gtk.viz": "viz",
152
118
            "bzrlib.plugins.gtk.annotate": "annotate",
153
 
            "bzrlib.plugins.gtk.olive": "olive",
154
119
            "bzrlib.plugins.gtk.tests": "tests",
155
120
            "bzrlib.plugins.gtk.branchview": "branchview",
156
121
            "bzrlib.plugins.gtk.preferences": "preferences",
159
124
            "bzrlib.plugins.gtk",
160
125
            "bzrlib.plugins.gtk.viz",
161
126
            "bzrlib.plugins.gtk.annotate",
162
 
            "bzrlib.plugins.gtk.olive",
163
127
            "bzrlib.plugins.gtk.tests",
164
128
            "bzrlib.plugins.gtk.branchview",
165
129
            "bzrlib.plugins.gtk.preferences",
166
130
        ],
167
 
        data_files=[('share/olive', ['cmenu.ui',
168
 
                                     ]),
169
 
                    ('share/bzr-gtk', ['credits.pickle']),
 
131
        data_files=[ ('share/bzr-gtk', ['credits.pickle']),
170
132
                    ('share/bzr-gtk/icons', ['icons/commit.png',
171
133
                                             'icons/commit16.png',
172
134
                                             'icons/diff.png',
178
140
                                             'icons/push.png',
179
141
                                             'icons/push16.png',
180
142
                                             'icons/refresh.png',
181
 
                                             'icons/olive-gtk.png',
182
 
                                             'icons/oliveicon2.png',
183
143
                                             'icons/sign-bad.png',
184
144
                                             'icons/sign-ok.png',
185
145
                                             'icons/sign.png',
187
147
                                             'icons/tag-16.png',
188
148
                                             'icons/bug.png',
189
149
                                             'icons/bzr-icon-64.png']),
190
 
                    ('share/applications', ['olive-gtk.desktop',
191
 
                                            'bazaar-properties.desktop',
 
150
                    ('share/applications', ['bazaar-properties.desktop',
192
151
                                            'bzr-handle-patch.desktop',
193
152
                                            'bzr-notify.desktop']),
194
153
                    ('share/application-registry', ['bzr-gtk.applications']),
195
 
                    ('share/pixmaps', ['icons/olive-gtk.png',
196
 
                                       'icons/bzr-icon-64.png']),
 
154
                    ('share/pixmaps', ['icons/bzr-icon-64.png']),
197
155
                    ('share/icons/hicolor/scalable/emblems',
198
156
                     ['icons/emblem-bzr-added.svg',
199
157
                      'icons/emblem-bzr-conflict.svg',