/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: 2009-06-15 14:02:08 UTC
  • mto: This revision was merged to the branch mainline in revision 649.
  • Revision ID: v.ladeuil+lp@free.fr-20090615140208-k5zg9c0vttrr9se8
Integrater Jelmer patch and implement a more robust solution.

* ui.py:
(GtkUIFactory._progress_all_finished): *Don't* uninstall the
widget.

* branchview/treeview.py:
(TreeView.__init__): Unconditionally install the progress widget
that will remain active until someone else install one or the
TreeView is destroyed.

Show diffs side-by-side

added added

removed removed

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