Ticket #331: add_cbz_support.patch
| File add_cbz_support.patch, 1.2 KB (added by sayamindu, 4 years ago) |
|---|
-
activity/activity.info
diff --git a/activity/activity.info b/activity/activity.info index 528e6bd..e0dcd5d 100644
a b 5 5 exec = sugar-activity readactivity.ReadActivity 6 6 show_launcher = no 7 7 activity_version = 63 8 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff 8 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/x-cbz;application/x-cbr 9 9 license = GPLv2+ -
readactivity.py
diff --git a/readactivity.py b/readactivity.py index bc78e72..b68c241 100644
a b 272 272 def read_file(self, file_path): 273 273 """Load a file from the datastore on activity start.""" 274 274 _logger.debug('ReadActivity.read_file: %s', file_path) 275 extension = os.path.splitext(file_path)[1] 275 276 tempfile = os.path.join(self.get_activity_root(), 'instance', 276 'tmp%i ' % time.time())277 'tmp%i%s' % (time.time(), extension)) 277 278 os.link(file_path, tempfile) 278 279 self._tempfile = tempfile 279 280 self._load_document('file://' + self._tempfile)
