Пример #1
0
    def columns(self):
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(
                self.context):
            self._columns = self.remove_column('preview')
            self._columns = self.remove_column('save_pdf_under_link')

        return self._columns
Пример #2
0
    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
Пример #3
0
    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
Пример #4
0
    def calculate_showroom_configuration(self, brains, b_start):
        """Calculates the number of documents from a list of brains
        and the offset depending on the batch-start position.
        """
        offset = 0
        number_of_documents = 0

        for i, brain in enumerate(brains):
            if not is_bumblebeeable(brain):
                continue

            if b_start > i:
                # increment the offset as long as we are
                # behind the batch start position
                offset += 1

            number_of_documents += 1

        self.offset = offset
        self.number_of_documents = number_of_documents
Пример #5
0
    def calculate_showroom_configuration(self, brains, b_start):
        """Calculates the number of documents from a list of brains
        and the offset depending on the batch-start position.
        """
        offset = 0
        number_of_documents = 0

        for i, brain in enumerate(brains):
            if not is_bumblebeeable(brain):
                continue

            if b_start > i:
                # increment the offset as long as we are
                # behind the batch start position
                offset += 1

            number_of_documents += 1

        self.offset = offset
        self.number_of_documents = number_of_documents
Пример #6
0
    def test_mails_are_bumblebeeable(self):
        mail = create(Builder('mail'))
        brain = obj2brain(mail)

        self.assertTrue(is_bumblebeeable(brain))
Пример #7
0
    def test_documents_are_bumblebeeable(self):
        document = create(Builder('document').with_dummy_content())
        brain = obj2brain(document)

        self.assertTrue(is_bumblebeeable(brain))
Пример #8
0
 def is_bumblebeeable(self):
     if not hasattr(self, '_is_bumblebeeable'):
         self._is_bumblebeeable = (is_bumblebee_feature_enabled()
                                   and is_bumblebeeable(self))
     return self._is_bumblebeeable
Пример #9
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
Пример #10
0
    def is_bumblebeeable(self):
        if not hasattr(self, '_is_bumblebeeable'):
            self._is_bumblebeeable = (
                is_bumblebee_feature_enabled() and is_bumblebeeable(self))

        return self._is_bumblebeeable
Пример #11
0
    def test_repo_roots_are_not_bumblebeeable(self):
        repository_root = create(Builder('repository_root'))
        brain = obj2brain(repository_root)

        self.assertFalse(is_bumblebeeable(brain))
Пример #12
0
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

        self.assertFalse(is_bumblebeeable(brain))
Пример #13
0
    def test_mails_are_bumblebeeable(self):
        mail = create(Builder('mail'))
        brain = obj2brain(mail)

        self.assertTrue(is_bumblebeeable(brain))
Пример #14
0
    def test_documents_are_bumblebeeable(self):
        document = create(Builder('document').with_dummy_content())
        brain = obj2brain(document)

        self.assertTrue(is_bumblebeeable(brain))
Пример #15
0
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

        self.assertFalse(is_bumblebeeable(brain))
Пример #16
0
    def test_repo_roots_are_not_bumblebeeable(self):
        repository_root = create(Builder('repository_root'))
        brain = obj2brain(repository_root)

        self.assertFalse(is_bumblebeeable(brain))
Пример #17
0
    def columns(self):
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(self.context):
            self._columns = self.remove_column('preview')
            self._columns = self.remove_column('save_pdf_under_link')

        return self._columns
Пример #18
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
Пример #19
0
 def is_bumblebeeable(self):
     if not hasattr(self, "_is_bumblebeeable"):
         self._is_bumblebeeable = is_bumblebee_feature_enabled() and is_bumblebeeable(self)
     return self._is_bumblebeeable