Merge lp:~jelmer/tribunal/mimetype into lp:tribunal

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Martin Pool
Approved revision: 168
Merged at revision: 166
Proposed branch: lp:~jelmer/tribunal/mimetype
Merge into: lp:tribunal
Diff against target: 104 lines (+47/-4)
5 files modified
setup.py (+22/-3)
tribunal-subunit.desktop (+9/-0)
tribunal-subunit.xml (+8/-0)
tribunal.applications (+7/-0)
tribunal/app.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/tribunal/mimetype
Reviewer Review Type Date Requested Status
Martin Pool Approve
The Tribunal code Pending
Review via email: mp+36690@code.launchpad.net

Commit message

Register subunit mimetype and register tribunal-subunit as a handler for that type.

Description of the change

Register the text/x-subunit mimetype using XDG and register tribunal-subunit as an application that can handle files of that type. This means that clicking on a .subunit file in nautilus will open it in tribunal.

This will also make tribunal appear in the "Programming" applications menu.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'setup.py' (properties changed: -x to +x)
--- setup.py 2010-04-03 06:08:13 +0000
+++ setup.py 2010-09-27 09:08:44 +0000
@@ -1,7 +1,20 @@
1#!/usr/bin/python
1"""Distutils installer for Tribunal."""2"""Distutils installer for Tribunal."""
23
4from distutils.command.install_data import install_data
3from distutils.core import setup5from distutils.core import setup
46
7class InstallData(install_data):
8
9 def run(self):
10 import subprocess
11 install_data.run(self)
12 subprocess.check_call(['xdg-mime', 'install', 'tribunal-subunit.xml'])
13 subprocess.check_call(['xdg-desktop-menu', 'install',
14 'tribunal-subunit.desktop'])
15
16
17
5setup(name='tribunal',18setup(name='tribunal',
6 maintainer='Martin Pool',19 maintainer='Martin Pool',
7 maintainer_email='mbp@sourcefrog.net',20 maintainer_email='mbp@sourcefrog.net',
@@ -9,8 +22,12 @@
9 description='A graphical test runner',22 description='A graphical test runner',
10 version='0.1.0',23 version='0.1.0',
11 packages=['tribunal'],24 packages=['tribunal'],
12 package_data={'tribunal': 25 package_data={'tribunal':
13 ['gavel_64x64.png', 'ui.glade']},26 ['gavel_64x64.png', 'ui.glade']},
27 data_files=[
28 ('share/application-registry', ['tribunal.applications']),
29 ('share/pixmaps', ['tribunal/gavel_64x64.png']),
30 ],
14 scripts=['tribunal-subunit'],31 scripts=['tribunal-subunit'],
15 classifiers=[32 classifiers=[
16 'Development Status :: 3 - Alpha',33 'Development Status :: 3 - Alpha',
@@ -19,4 +36,6 @@
19 'License :: OSI Approved :: Apache Software License',36 'License :: OSI Approved :: Apache Software License',
20 'Programming Language :: Python :: 2',37 'Programming Language :: Python :: 2',
21 'Topic :: Software Development :: Testing',38 'Topic :: Software Development :: Testing',
22 ])39 ],
40 cmdclass={'install_data': InstallData},
41 )
2342
=== added file 'tribunal-subunit.desktop'
--- tribunal-subunit.desktop 1970-01-01 00:00:00 +0000
+++ tribunal-subunit.desktop 2010-09-27 09:08:44 +0000
@@ -0,0 +1,9 @@
1[Desktop Entry]
2Name=Tribunal
3Comment=View Subunit File
4Icon=gavel_64x64
5Exec=tribunal-subunit %f
6Terminal=false
7Type=Application
8Categories=Development;
9MimeType=text/x-subunit;
010
=== added file 'tribunal-subunit.xml'
--- tribunal-subunit.xml 1970-01-01 00:00:00 +0000
+++ tribunal-subunit.xml 2010-09-27 09:08:44 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3 <mime-type type="text/x-subunit">
4 <sub-class-of type="text/plain"/>
5 <glob pattern="*.subunit"/>
6 <comment>Subunit test result stream</comment>
7 </mime-type>
8</mime-info>
09
=== added file 'tribunal.applications'
--- tribunal.applications 1970-01-01 00:00:00 +0000
+++ tribunal.applications 2010-09-27 09:08:44 +0000
@@ -0,0 +1,7 @@
1tribunal-subunit
2 command=tribunal-subunit
3 name=Tribunal
4 can_open_multiple_files=false
5 expects_uris=false
6 requires_terminal=false
7 mime_types=text/x-subunit
08
=== modified file 'tribunal/app.py'
--- tribunal/app.py 2010-08-22 00:55:27 +0000
+++ tribunal/app.py 2010-09-27 09:08:44 +0000
@@ -119,7 +119,7 @@
119 def _set_default_icons(self):119 def _set_default_icons(self):
120 # XXX: maybe should use pkgresources?120 # XXX: maybe should use pkgresources?
121 icon_pixbuf = gtk.gdk.pixbuf_new_from_file(121 icon_pixbuf = gtk.gdk.pixbuf_new_from_file(
122 os.path.join(os.path.dirname(tribunal.__file__), 'gavel_64x64.jpg'))122 os.path.join(os.path.dirname(tribunal.__file__), 'gavel_64x64.png'))
123 gtk.window_set_default_icon_list(icon_pixbuf)123 gtk.window_set_default_icon_list(icon_pixbuf)
124124
125125
126126
=== removed file 'tribunal/gavel_64x64.jpg'
127Binary files tribunal/gavel_64x64.jpg 2010-02-13 07:46:25 +0000 and tribunal/gavel_64x64.jpg 1970-01-01 00:00:00 +0000 differ127Binary files tribunal/gavel_64x64.jpg 2010-02-13 07:46:25 +0000 and tribunal/gavel_64x64.jpg 1970-01-01 00:00:00 +0000 differ
=== added file 'tribunal/gavel_64x64.png'
128Binary files tribunal/gavel_64x64.png 1970-01-01 00:00:00 +0000 and tribunal/gavel_64x64.png 2010-09-27 09:08:44 +0000 differ128Binary files tribunal/gavel_64x64.png 1970-01-01 00:00:00 +0000 and tribunal/gavel_64x64.png 2010-09-27 09:08:44 +0000 differ

Subscribers

People subscribed via source and target branches

to all changes: