Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #331: add_cbz_support.patch

File add_cbz_support.patch, 1.2 KB (added by sayamindu, 4 years ago)

Patch to implement feature.

  • activity/activity.info

    diff --git a/activity/activity.info b/activity/activity.info
    index 528e6bd..e0dcd5d 100644
    a b  
    55exec = sugar-activity readactivity.ReadActivity 
    66show_launcher = no 
    77activity_version = 63 
    8 mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff 
     8mime_types = application/pdf;image/vnd.djvu;image/x.djvu;image/tiff;application/x-cbz;application/x-cbr 
    99license = GPLv2+ 
  • readactivity.py

    diff --git a/readactivity.py b/readactivity.py
    index bc78e72..b68c241 100644
    a b  
    272272    def read_file(self, file_path): 
    273273        """Load a file from the datastore on activity start.""" 
    274274        _logger.debug('ReadActivity.read_file: %s', file_path) 
     275        extension = os.path.splitext(file_path)[1] 
    275276        tempfile = os.path.join(self.get_activity_root(), 'instance', 
    276                                 'tmp%i' % time.time()) 
     277                                'tmp%i%s' % (time.time(), extension)) 
    277278        os.link(file_path, tempfile) 
    278279        self._tempfile = tempfile 
    279280        self._load_document('file://' + self._tempfile)