call site 2 for path.local.check
apigen/rest/testing/test_rest.py - line 140
137
138
139
140
141
142
143
   def test_write_section(self):
       tempdir = temppath.ensure('htmldirwriter', dir=1)
       hdw = self.get_filled_writer(HTMLDirWriter, HTMLHandler, HTMLHandler,
->                                  tempdir)
       assert tempdir.join('foo.html').check(file=1)
       assert tempdir.join('bar.html').check(file=1)
       assert tempdir.join('foo.html').read().startswith('<html>')
apigen/rest/testing/test_rest.py - line 88
86
87
88
89
90
   def get_filled_writer(self, writerclass, *args, **kwargs):
       dw = writerclass(*args, **kwargs)
->     dw.write_section('foo', Rest(Paragraph('foo data')))
       dw.write_section('bar', Rest(Paragraph('bar data')))
       return dw
apigen/rest/genrest.py - line 176
168
169
170
171
172
173
174
175
176
   def write_section(self, name, rest):
       if name == 'index':
           handler = self.indexhandler
       else:
           handler = self.filehandler
       h = handler(name)
       t = RestTransformer(rest)
       t.parse(h)
->     self.directory.ensure('%s.html' % (name,)).write(h.html)
path/local/local.py - line 307
298
299
300
301
302
303
304
305
306
307
308
309
310
   def ensure(self, *args, **kwargs):
       """ ensure that an args-joined path exists (by default as
               a file). if you specify a keyword argument 'dir=True'
               then the path is forced to be a directory path.
           """
       p = self.join(*args)
       if kwargs.get('dir', 0):
           return p._ensuredirs()
       else:
->         p.dirpath()._ensuredirs()
           if not p.check(file=1):
               p.write("")
           return p
path/local/local.py - line 288
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
   def _ensuredirs(self):
       parent = self.dirpath()
       if parent == self:
           return self
       if parent.check(dir=0):
           parent._ensuredirs()
->     if self.check(dir=0):
           try:
               self.mkdir()
           except py.error.EEXIST:
               # race condition: file/dir created by another thread/process.
               # complain if it is not a dir
               if self.check(dir=0):
                   raise
       return self