コード例 #1
0
 def target_partname(self):
     """
     |PackURI| instance containing partname targeted by this relationship.
     Raises ``ValueError`` on reference if target_mode is ``'External'``.
     Use :attr:`target_mode` to check before referencing.
     """
     if self.is_external:
         msg = ('target_partname attribute on Relationship is undefined w'
                'here TargetMode == "External"')
         raise ValueError(msg)
     # lazy-load _target_partname attribute
     if not hasattr(self, '_target_partname'):
         self._target_partname = PackURI.from_rel_ref(
             self._baseURI, self.target_ref)
     return self._target_partname
コード例 #2
0
 def it_can_construct_from_relative_ref(self):
     baseURI = '/ppt/slides'
     relative_ref = '../slideLayouts/slideLayout1.xml'
     pack_uri = PackURI.from_rel_ref(baseURI, relative_ref)
     assert pack_uri == '/ppt/slideLayouts/slideLayout1.xml'