コード例 #1
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
    def it_can_clone_the_notes_master_placeholders(self, request,
                                                   notes_master_, shapes_):
        placeholders = notes_master_.placeholders = (
            BaseShape(element("p:sp/p:nvSpPr/p:nvPr/p:ph{type=body}"), None),
            BaseShape(element("p:sp/p:nvSpPr/p:nvPr/p:ph{type=dt}"), None),
        )
        property_mock(request, NotesSlide, "shapes", return_value=shapes_)
        notes_slide = NotesSlide(None, None)

        notes_slide.clone_master_placeholders(notes_master_)

        assert shapes_.clone_placeholder.call_args_list == [
            call(placeholders[0])
        ]
コード例 #2
0
 def clone_fixture(self, notes_master_, clone_placeholder_, shapes_prop_, shapes_):
     notes_slide = NotesSlide(None, None)
     placeholders = notes_master_.placeholders = (
         BaseShape(element("p:sp/p:nvSpPr/p:nvPr/p:ph{type=body}"), None),
         BaseShape(element("p:sp/p:nvSpPr/p:nvPr/p:ph{type=dt}"), None),
     )
     calls = [call(placeholders[0])]
     shapes_.clone_placeholder = clone_placeholder_
     return notes_slide, notes_master_, clone_placeholder_, calls
コード例 #3
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
 def notes_tf_fixture(self, request, notes_placeholder_prop_, placeholder_,
                      text_frame_):
     has_text_frame = request.param
     notes_slide = NotesSlide(None, None)
     if has_text_frame:
         notes_placeholder_prop_.return_value = placeholder_
         placeholder_.text_frame = text_frame_
         expected_value = text_frame_
     else:
         notes_placeholder_prop_.return_value = None
         expected_value = None
     return notes_slide, expected_value
コード例 #4
0
 def notes_ph_fixture(self, request, placeholders_prop_):
     type_names, match = request.param
     notes_slide = NotesSlide(None, None)
     placeholders_ = []
     for type_name in type_names:
         placeholder_ = instance_mock(
             request, NotesSlidePlaceholder, name="%s-placeholder" % type_name
         )
         placeholder_.placeholder_format.type = getattr(PP_PLACEHOLDER, type_name)
         placeholders_.append(placeholder_)
     placeholders_prop_.return_value = placeholders_
     expected_value = None if match is None else placeholders_[match]
     return notes_slide, expected_value
コード例 #5
0
 def notes_slide(self):
     """
     Return the |NotesSlide| object that proxies this notes slide part.
     """
     return NotesSlide(self._element, self)
コード例 #6
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
 def shapes_fixture(self, NotesSlideShapes_, shapes_):
     notes = element("p:notes/p:cSld/p:spTree")
     notes_slide = NotesSlide(notes, None)
     spTree = notes.xpath("//p:spTree")[0]
     return notes_slide, NotesSlideShapes_, spTree, shapes_
コード例 #7
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
 def placeholders_fixture(self, NotesSlidePlaceholders_, placeholders_):
     notes = element("p:notes/p:cSld/p:spTree")
     notes_slide = NotesSlide(notes, None)
     spTree = notes.xpath("//p:spTree")[0]
     return notes_slide, NotesSlidePlaceholders_, spTree, placeholders_