updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / calibre-bzr / desktop_integration.patch
blobe6ecb9684d4d44e51d4a3893dfff67bbf5ecd1a2
1 --- a/src/calibre/linux.py 2011-06-17 19:56:05.000000000 +0200
2 +++ b/src/calibre/linux.py 2011-06-18 00:07:46.000000000 +0200
3 @@ -339,51 +339,39 @@
5 with TemporaryDirectory() as tdir:
6 with CurrentDir(tdir):
7 - render_img('mimetypes/lrf.png', 'calibre-lrf.png')
8 - check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf', shell=True)
9 - self.icon_resources.append(('mimetypes', 'application-lrf', '128'))
10 - check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png text-lrs', shell=True)
11 - self.icon_resources.append(('mimetypes', 'application-lrs',
12 - '128'))
13 - render_img('lt.png', 'calibre-gui.png')
14 - check_call('xdg-icon-resource install --noupdate --size 128 calibre-gui.png calibre-gui', shell=True)
15 - self.icon_resources.append(('apps', 'calibre-gui', '128'))
16 - render_img('viewer.png', 'calibre-viewer.png')
17 - check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True)
18 - self.icon_resources.append(('apps', 'calibre-viewer', '128'))
19 + dir = os.path.join(self.opts.staging_sharedir,'../pixmaps')
20 + os.mkdir(dir)
21 + render_img('mimetypes/lrf.png', os.path.join(dir,'calibre-lrf.png'))
22 + render_img('lt.png', os.path.join(dir, 'calibre-gui.png'))
23 + render_img('viewer.png', os.path.join(dir, 'calibre-viewer.png'))
25 mimetypes = set([])
26 for x in all_input_formats():
27 mt = guess_type('dummy.'+x)[0]
28 - if mt and 'chemical' not in mt and 'ctc-posml' not in mt:
29 + if mt and 'chemical' not in mt and 'ctc-posml' not in mt and 'text' not in mt and 'pdf' not in mt and 'xhtml' not in mt:
30 mimetypes.add(mt)
32 def write_mimetypes(f):
33 f.write('MimeType=%s;\n'%';'.join(mimetypes))
35 - f = open('calibre-lrfviewer.desktop', 'wb')
36 + dir = os.path.join(self.opts.staging_sharedir,'../applications')
37 + os.mkdir(dir)
38 + f = open(os.path.join(dir, 'calibre-lrfviewer.desktop'), 'wb')
39 f.write(VIEWER)
40 f.close()
41 - f = open('calibre-ebook-viewer.desktop', 'wb')
42 + f = open(os.path.join(dir, 'calibre-ebook-viewer.desktop'), 'wb')
43 f.write(EVIEWER)
44 write_mimetypes(f)
45 f.close()
46 - f = open('calibre-gui.desktop', 'wb')
47 + f = open(os.path.join(dir, 'calibre-gui.desktop'), 'wb')
48 f.write(GUI)
49 write_mimetypes(f)
50 f.close()
51 - des = ('calibre-gui.desktop', 'calibre-lrfviewer.desktop',
52 - 'calibre-ebook-viewer.desktop')
53 - for x in des:
54 - cmd = ['xdg-desktop-menu', 'install', '--noupdate', './'+x]
55 - check_call(' '.join(cmd), shell=True)
56 - self.menu_resources.append(x)
57 - check_call(['xdg-desktop-menu', 'forceupdate'])
58 - f = open('calibre-mimetypes', 'wb')
59 + dir = os.path.join(self.opts.staging_sharedir,'../mime/packages/')
60 + os.makedirs(dir)
61 + f = open(os.path.join(dir, 'calibre.xml'), 'wb')
62 f.write(MIME)
63 f.close()
64 - self.mime_resources.append('calibre-mimetypes')
65 - check_call('xdg-mime install ./calibre-mimetypes', shell=True)
66 except Exception:
67 if self.opts.fatal_errors:
68 raise