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
1=== modified file 'setup.py' (properties changed: -x to +x)
2--- setup.py 2010-04-03 06:08:13 +0000
3+++ setup.py 2010-09-27 09:08:44 +0000
4@@ -1,7 +1,20 @@
5+#!/usr/bin/python
6 """Distutils installer for Tribunal."""
7
8+from distutils.command.install_data import install_data
9 from distutils.core import setup
10
11+class InstallData(install_data):
12+
13+ def run(self):
14+ import subprocess
15+ install_data.run(self)
16+ subprocess.check_call(['xdg-mime', 'install', 'tribunal-subunit.xml'])
17+ subprocess.check_call(['xdg-desktop-menu', 'install',
18+ 'tribunal-subunit.desktop'])
19+
20+
21+
22 setup(name='tribunal',
23 maintainer='Martin Pool',
24 maintainer_email='mbp@sourcefrog.net',
25@@ -9,8 +22,12 @@
26 description='A graphical test runner',
27 version='0.1.0',
28 packages=['tribunal'],
29- package_data={'tribunal':
30- ['gavel_64x64.png', 'ui.glade']},
31+ package_data={'tribunal':
32+ ['gavel_64x64.png', 'ui.glade']},
33+ data_files=[
34+ ('share/application-registry', ['tribunal.applications']),
35+ ('share/pixmaps', ['tribunal/gavel_64x64.png']),
36+ ],
37 scripts=['tribunal-subunit'],
38 classifiers=[
39 'Development Status :: 3 - Alpha',
40@@ -19,4 +36,6 @@
41 'License :: OSI Approved :: Apache Software License',
42 'Programming Language :: Python :: 2',
43 'Topic :: Software Development :: Testing',
44- ])
45+ ],
46+ cmdclass={'install_data': InstallData},
47+ )
48
49=== added file 'tribunal-subunit.desktop'
50--- tribunal-subunit.desktop 1970-01-01 00:00:00 +0000
51+++ tribunal-subunit.desktop 2010-09-27 09:08:44 +0000
52@@ -0,0 +1,9 @@
53+[Desktop Entry]
54+Name=Tribunal
55+Comment=View Subunit File
56+Icon=gavel_64x64
57+Exec=tribunal-subunit %f
58+Terminal=false
59+Type=Application
60+Categories=Development;
61+MimeType=text/x-subunit;
62
63=== added file 'tribunal-subunit.xml'
64--- tribunal-subunit.xml 1970-01-01 00:00:00 +0000
65+++ tribunal-subunit.xml 2010-09-27 09:08:44 +0000
66@@ -0,0 +1,8 @@
67+<?xml version="1.0" encoding="UTF-8"?>
68+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
69+ <mime-type type="text/x-subunit">
70+ <sub-class-of type="text/plain"/>
71+ <glob pattern="*.subunit"/>
72+ <comment>Subunit test result stream</comment>
73+ </mime-type>
74+</mime-info>
75
76=== added file 'tribunal.applications'
77--- tribunal.applications 1970-01-01 00:00:00 +0000
78+++ tribunal.applications 2010-09-27 09:08:44 +0000
79@@ -0,0 +1,7 @@
80+tribunal-subunit
81+ command=tribunal-subunit
82+ name=Tribunal
83+ can_open_multiple_files=false
84+ expects_uris=false
85+ requires_terminal=false
86+ mime_types=text/x-subunit
87
88=== modified file 'tribunal/app.py'
89--- tribunal/app.py 2010-08-22 00:55:27 +0000
90+++ tribunal/app.py 2010-09-27 09:08:44 +0000
91@@ -119,7 +119,7 @@
92 def _set_default_icons(self):
93 # XXX: maybe should use pkgresources?
94 icon_pixbuf = gtk.gdk.pixbuf_new_from_file(
95- os.path.join(os.path.dirname(tribunal.__file__), 'gavel_64x64.jpg'))
96+ os.path.join(os.path.dirname(tribunal.__file__), 'gavel_64x64.png'))
97 gtk.window_set_default_icon_list(icon_pixbuf)
98
99
100
101=== removed file 'tribunal/gavel_64x64.jpg'
102Binary 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
103=== added file 'tribunal/gavel_64x64.png'
104Binary 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: