Пример #1
0
def generate_attachment_preview_images(obj):
    if (IAttachmentStoragable is not None and
            IAttachmentStoragable.providedBy(obj)):
        attachment_storage = IAttachmentStorage(obj)
        for att_id in attachment_storage.keys():
            docconv = IDocconv(attachment_storage.get(att_id))
            if not docconv.has_thumbs():
                docconv.generate_all()
Пример #2
0
 def update(self):
     docconv = IDocconv(self.context)
     if docconv.generate_all():
         self.message = (
             'Your request for a PDF version of this document '
             'is being processed. It will take a few minutes until it is '
             'ready for download. Please check back later.')
     else:
         self.message = (
             'A PDF version of this document has been requested'
             ' and is in preparation. It will be available for download '
             'shortly. Please select the download button from the gearbox'
             ' again in a few minutes.')