/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: Vincent Ladeuil
  • Date: 2010-03-01 08:48:46 UTC
  • mto: This revision was merged to the branch mainline in revision 683.
  • Revision ID: v.ladeuil+lp@free.fr-20100301084846-t2hg35ewe1wiazap
Split lines too long and get rid of spurious spaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        install_data.run(self)
89
89
 
90
90
        try:
91
 
            subprocess.check_call('gtk-update-icon-cache -f -t /usr/share/icons/hicolor')
 
91
            subprocess.check_call('gtk-update-icon-cache '
 
92
                                  '-f -t /usr/share/icons/hicolor')
92
93
        except OSError:
93
94
            pass
94
95
 
95
96
    def _compile_po_files(self):
96
97
        data_files = []
97
 
        
 
98
 
98
99
        # Don't install language files on Win32
99
100
        if sys.platform == 'win32':
100
101
            return data_files
101
 
        
 
102
 
102
103
        PO_DIR = 'po'
103
104
        for po in glob.glob(os.path.join(PO_DIR,'*.po')):
104
105
            lang = os.path.basename(po[:-3])
105
106
            # It's necessary to compile in this directory (not in po_dir)
106
107
            # because install_data can't rename file
107
108
            mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
108
 
            
 
109
 
109
110
            directory = os.path.dirname(mo)
110
111
            if not os.path.exists(directory):
111
112
                info('creating %s' % directory)
112
113
                os.makedirs(directory)
113
 
            
114
114
            if newer(po, mo):
115
115
                # True if mo doesn't exist
116
116
                cmd = 'msgfmt -o %s %s' % (mo, po)
117
117
                info('compiling %s -> %s' % (po, mo))
118
118
                if os.system(cmd) != 0:
119
119
                    raise SystemExit('Error while running msgfmt')
120
 
                
121
 
                dest = os.path.dirname(os.path.join('share', 'locale', lang, 'LC_MESSAGES', 'olive-gtk.mo'))
 
120
                dest = os.path.dirname(
 
121
                    os.path.join('share', 'locale', lang,
 
122
                                 'LC_MESSAGES', 'olive-gtk.mo'))
122
123
                data_files.append((dest, [mo]))
123
 
        
124
124
        return data_files
125
 
    
 
125
 
126
126
    def _nautilus_plugin(self):
127
127
        files = []
128
128
        if sys.platform[:5] == 'linux':
129
 
            cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
 
129
            cmd = os.popen('pkg-config --variable=pythondir nautilus-python',
 
130
                           'r')
130
131
            res = cmd.readline().strip()
131
132
            ret = cmd.close()
132
 
            
133
133
            if ret is None:
134
134
                dest = res[5:]
135
135
                files.append((dest, ['nautilus-bzr.py']))
136
 
        
137
136
        return files
138
137
 
139
138
 
140
139
if __name__ == '__main__':
141
140
    setup(
142
 
    name = "bzr-gtk",
143
 
    version = "0.99.0",
144
 
    maintainer = "Jelmer Vernooij",
145
 
    maintainer_email = "jelmer@samba.org",
146
 
    description = "GTK+ Frontends for various Bazaar commands",
147
 
    license = "GNU GPL v2 or later",
148
 
    scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
149
 
    url = "http://bazaar-vcs.org/BzrGtk",
150
 
    package_dir = {
151
 
        "bzrlib.plugins.gtk": ".",
152
 
        "bzrlib.plugins.gtk.viz": "viz",
153
 
        "bzrlib.plugins.gtk.annotate": "annotate",
154
 
        "bzrlib.plugins.gtk.olive": "olive",
155
 
        "bzrlib.plugins.gtk.tests": "tests",
156
 
        "bzrlib.plugins.gtk.branchview": "branchview",
157
 
        "bzrlib.plugins.gtk.preferences": "preferences",
158
 
        },
159
 
    packages = [
160
 
        "bzrlib.plugins.gtk",
161
 
        "bzrlib.plugins.gtk.viz",
162
 
        "bzrlib.plugins.gtk.annotate",
163
 
        "bzrlib.plugins.gtk.olive",
164
 
        "bzrlib.plugins.gtk.tests",
165
 
        "bzrlib.plugins.gtk.branchview",
166
 
        "bzrlib.plugins.gtk.preferences",
 
141
        name = "bzr-gtk",
 
142
        version = "0.99.0",
 
143
        maintainer = "Jelmer Vernooij",
 
144
        maintainer_email = "jelmer@samba.org",
 
145
        description = "GTK+ Frontends for various Bazaar commands",
 
146
        license = "GNU GPL v2 or later",
 
147
        scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
 
148
        url = "http://bazaar-vcs.org/BzrGtk",
 
149
        package_dir = {
 
150
            "bzrlib.plugins.gtk": ".",
 
151
            "bzrlib.plugins.gtk.viz": "viz",
 
152
            "bzrlib.plugins.gtk.annotate": "annotate",
 
153
            "bzrlib.plugins.gtk.olive": "olive",
 
154
            "bzrlib.plugins.gtk.tests": "tests",
 
155
            "bzrlib.plugins.gtk.branchview": "branchview",
 
156
            "bzrlib.plugins.gtk.preferences": "preferences",
 
157
            },
 
158
        packages = [
 
159
            "bzrlib.plugins.gtk",
 
160
            "bzrlib.plugins.gtk.viz",
 
161
            "bzrlib.plugins.gtk.annotate",
 
162
            "bzrlib.plugins.gtk.olive",
 
163
            "bzrlib.plugins.gtk.tests",
 
164
            "bzrlib.plugins.gtk.branchview",
 
165
            "bzrlib.plugins.gtk.preferences",
167
166
        ],
168
 
    data_files=[('share/olive', ['cmenu.ui',
169
 
                                ]),
170
 
                ('share/bzr-gtk', ['credits.pickle']),
171
 
               ('share/bzr-gtk/icons', ['icons/commit.png',
172
 
                                 'icons/commit16.png',
173
 
                                 'icons/diff.png',
174
 
                                 'icons/diff16.png',
175
 
                                 'icons/log.png',
176
 
                                 'icons/log16.png',
177
 
                                 'icons/pull.png',
178
 
                                 'icons/pull16.png',
179
 
                                 'icons/push.png',
180
 
                                 'icons/push16.png',
181
 
                                 'icons/refresh.png',
182
 
                                 'icons/olive-gtk.png',
183
 
                                 'icons/oliveicon2.png',
184
 
                                 'icons/sign-bad.png',
185
 
                                 'icons/sign-ok.png',
186
 
                                 'icons/sign.png',
187
 
                                 'icons/sign-unknown.png',
188
 
                                 'icons/tag-16.png',
189
 
                                 'icons/bug.png',
190
 
                                 'icons/bzr-icon-64.png']),
191
 
                ('share/applications', ['olive-gtk.desktop',
192
 
                                        'bazaar-properties.desktop',
193
 
                                        'bzr-handle-patch.desktop',
194
 
                                        'bzr-notify.desktop']),
195
 
                ('share/application-registry', ['bzr-gtk.applications']),
196
 
                ('share/pixmaps', ['icons/olive-gtk.png',
197
 
                                   'icons/bzr-icon-64.png']),
198
 
                ('share/icons/hicolor/scalable/emblems',
199
 
                    ['icons/emblem-bzr-added.svg',
200
 
                        'icons/emblem-bzr-conflict.svg',
201
 
                        'icons/emblem-bzr-controlled.svg',
202
 
                        'icons/emblem-bzr-modified.svg',
203
 
                        'icons/emblem-bzr-removed.svg',
204
 
                        'icons/emblem-bzr-ignored.svg'])
205
 
               ],
206
 
    cmdclass={'install_data': InstallData,
207
 
              'build_credits': CreateCredits,
208
 
              'build': BuildData,
209
 
              'check': Check}
210
 
)
 
167
        data_files=[('share/olive', ['cmenu.ui',
 
168
                                     ]),
 
169
                    ('share/bzr-gtk', ['credits.pickle']),
 
170
                    ('share/bzr-gtk/icons', ['icons/commit.png',
 
171
                                             'icons/commit16.png',
 
172
                                             'icons/diff.png',
 
173
                                             'icons/diff16.png',
 
174
                                             'icons/log.png',
 
175
                                             'icons/log16.png',
 
176
                                             'icons/pull.png',
 
177
                                             'icons/pull16.png',
 
178
                                             'icons/push.png',
 
179
                                             'icons/push16.png',
 
180
                                             'icons/refresh.png',
 
181
                                             'icons/olive-gtk.png',
 
182
                                             'icons/oliveicon2.png',
 
183
                                             'icons/sign-bad.png',
 
184
                                             'icons/sign-ok.png',
 
185
                                             'icons/sign.png',
 
186
                                             'icons/sign-unknown.png',
 
187
                                             'icons/tag-16.png',
 
188
                                             'icons/bug.png',
 
189
                                             'icons/bzr-icon-64.png']),
 
190
                    ('share/applications', ['olive-gtk.desktop',
 
191
                                            'bazaar-properties.desktop',
 
192
                                            'bzr-handle-patch.desktop',
 
193
                                            'bzr-notify.desktop']),
 
194
                    ('share/application-registry', ['bzr-gtk.applications']),
 
195
                    ('share/pixmaps', ['icons/olive-gtk.png',
 
196
                                       'icons/bzr-icon-64.png']),
 
197
                    ('share/icons/hicolor/scalable/emblems',
 
198
                     ['icons/emblem-bzr-added.svg',
 
199
                      'icons/emblem-bzr-conflict.svg',
 
200
                      'icons/emblem-bzr-controlled.svg',
 
201
                      'icons/emblem-bzr-modified.svg',
 
202
                      'icons/emblem-bzr-removed.svg',
 
203
                      'icons/emblem-bzr-ignored.svg'])
 
204
                    ],
 
205
        cmdclass={'install_data': InstallData,
 
206
                  'build_credits': CreateCredits,
 
207
                  'build': BuildData,
 
208
                  'check': Check}
 
209
        )