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
5 with TemporaryDirectory() as 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',
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')
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'))
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:
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')
38 + f = open(os.path.join(dir, 'calibre-lrfviewer.desktop'), 'wb')
41 - f = open('calibre-ebook-viewer.desktop', 'wb')
42 + f = open(os.path.join(dir, 'calibre-ebook-viewer.desktop'), 'wb')
46 - f = open('calibre-gui.desktop', 'wb')
47 + f = open(os.path.join(dir, 'calibre-gui.desktop'), 'wb')
51 - des = ('calibre-gui.desktop', 'calibre-lrfviewer.desktop',
52 - 'calibre-ebook-viewer.desktop')
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/')
61 + f = open(os.path.join(dir, 'calibre.xml'), 'wb')
64 - self.mime_resources.append('calibre-mimetypes')
65 - check_call('xdg-mime install ./calibre-mimetypes', shell=True)
67 if self.opts.fatal_errors: