call site 4 for path.local.relto
apigen/testing/test_apigen_example.py - line 224
221
222
223
224
225
226
227
228
229
230
231
232
233
   def test_build_class_pages_base_link(self):
       self.apb.build_class_pages(['main.SomeSubClass',
                                   'main.SomeClass'])
->     self.linker.replace_dirpath(self.base, False)
       clsfile = self.base.join('api/main.SomeSubClass.html')
       assert clsfile.check()
       html = clsfile.read()
       print html
       run_string_sequence_test(html, [
           'href="../style.css"',
           'href="main.SomeClass.html">main.SomeClass',
       ])
       _checkhtml(html)
apigen/linker.py - line 95
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
   def replace_dirpath(self, dirpath, stoponerrors=True):
       """ replace temporary links in all html files in dirpath and below """
       for fpath in dirpath.visit('*.html'):
           html = fpath.read()
           while 1:
               match = self._reg_tempurl.search(html)
               if not match:
                   break
               tempurl = match.group(1)
               try:
                   html = html.replace('"' + tempurl + '"',
                                       '"' + self.get_target(tempurl,
->                                             fpath.relto(dirpath)) + '"')
               except KeyError:
                   if stoponerrors:
                       raise
                   html = html.replace('"' + tempurl + '"',
                                       '"apigen.notfound://%s"' % (tempurl,))
           fpath.write(html)