def columns(self): """Disable pdf_preview link in deployments without pdfconverter. """ if not is_bumblebee_feature_enabled() or not is_bumblebeeable(self.context): self._columns = self.remove_column('preview') if not is_pdfconverter_enabled(): self._columns = self.remove_column('pdf_preview_link') return self._columns
def columns(self): """Disable pdf_preview link in deployments without pdfconverter. """ if not is_bumblebee_feature_enabled() or not is_bumblebeeable( self.context): self._columns = self.remove_column('preview') if not is_pdfconverter_enabled(): self._columns = self.remove_column('pdf_preview_link') return self._columns
def test_mail_overview_tab(self, browser): mail = create( Builder('mail').with_asset_message( 'mail_with_multiple_attachments.eml')) browser.login().visit(mail, view='tabbedview_view-overview') view = mail.restrictedTraverse('tabbedview_view-overview') if not view.is_preview_supported(): # Unexpected preconditions, print debug output for CI tests print "view.is_preview_supported() is unexpectedly False!" from opengever.base.pdfconverter import is_pdfconverter_enabled print "is_pdfconverter_enabled(): %r" % is_pdfconverter_enabled() import pkg_resources dist = pkg_resources.get_distribution('opengever.pdfconverter') print( "pkg_resources.get_distribution" "('opengever.pdfconverter'): %r" % dist) from opengever.bumblebee import is_bumblebee_feature_enabled print("is_bumblebee_feature_enabled(): " "%r" % is_bumblebee_feature_enabled()) expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], [ 'Original message', u'mehrere-anhange.eml \u2014 32 KB ' u'Checkout and edit Download copy' ], [ 'Attachments', 'Inneres Testma?il ohne Attachments.eml 1 KB ' 'word_document.docx 22.4 KB ' 'Text.txt 1 KB ' 'Save attachments' ], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())
def test_mail_overview_tab(self, browser): mail = create(Builder('mail') .with_asset_message( 'mail_with_multiple_attachments.eml')) browser.login().visit(mail, view='tabbedview_view-overview') view = mail.restrictedTraverse('tabbedview_view-overview') if not view.is_preview_supported(): # Unexpected preconditions, print debug output for CI tests print "view.is_preview_supported() is unexpectedly False!" from opengever.base.pdfconverter import is_pdfconverter_enabled print "is_pdfconverter_enabled(): %r" % is_pdfconverter_enabled() import pkg_resources dist = pkg_resources.get_distribution('opengever.pdfconverter') print("pkg_resources.get_distribution" "('opengever.pdfconverter'): %r" % dist) from opengever.bumblebee import is_bumblebee_feature_enabled print ("is_bumblebee_feature_enabled(): " "%r" % is_bumblebee_feature_enabled()) expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], ['Original message', u'mehrere-anhange.eml \u2014 32 KB ' u'Checkout and edit Download copy'], ['Attachments', 'Inneres Testma?il ohne Attachments.eml 1 KB ' 'word_document.docx 22.4 KB ' 'Text.txt 1 KB ' 'Save attachments'], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())
def is_preview_supported(self): # XXX TODO: should be persistent called two times if is_pdfconverter_enabled(): return IPreviewMarker.providedBy(self.context) return False
def is_preview_supported(self): # XXX TODO: should be persistent called two times if is_pdfconverter_enabled(): return True return False
def preview_link_available(self): return self.document.is_document and is_pdfconverter_enabled()