call site 1 for path.local.new
apigen/rest/testing/test_rest.py - line 95
93
94
95
96
97
98
99
100
   def test_write_section(self):
       tempdir = temppath.ensure('dirwriter', dir=True)
->     dw = self.get_filled_writer(DirWriter, tempdir)
       fpaths = tempdir.listdir('*.txt')
       assert len(fpaths) == 2
       assert sorted([f.basename for f in fpaths]) == ['bar.txt', 'foo.txt']
       assert _nl(tempdir.join('foo.txt').read()) == 'foo data\n'
       assert _nl(tempdir.join('bar.txt').read()) == 'bar data\n'
apigen/rest/testing/test_rest.py - line 89
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 127
125
126
127
   def write_section(self, name, rest):
       filename = '%s.txt' % (name,)
->     self.directory.ensure(filename).write(rest.text())
path/local/local.py - line 303
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 192
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
   def join(self, *args, **kwargs):
       """ return a new path by appending all 'args' as path
           components.  if abs=1 is used restart from root if any
           of the args is an absolute path.
           """
       if not args:
           return self
       strpath = self.strpath
       sep = self.sep
       strargs = [str(x) for x in args]
       if kwargs.get('abs', 0):
           for i in range(len(strargs)-1, -1, -1):
               if os.path.isabs(strargs[i]):
                   strpath = strargs[i]
                   strargs = strargs[i+1:]
                   break
       for arg in strargs:
           arg = arg.strip(sep)
           if py.std.sys.platform == 'win32':
               # allow unix style paths even on windows.
               arg = arg.strip('/')
               arg = arg.replace('/', sep)
           if arg:
               if not strpath.endswith(sep):
                   strpath += sep
               strpath += arg
->     obj = self.new()
       obj.strpath = os.path.normpath(strpath)
       return obj