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.
def ensure(self, *args, **kwargs):
origin: path.local
where:
function source:
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
called in /home/johnny/projects/merlinux/py/dist/py/apigen/source/testing/test_browser.py
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/testing/test_rest.py
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/testing/test_rest.py
called in /home/johnny/projects/merlinux/py/dist/py/documentation/test_conftest.py
called in /home/johnny/projects/merlinux/py/dist/py/apigen/source/testing/test_browser.py
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/genrest.py
called in /home/johnny/projects/merlinux/py/dist/py/apigen/source/testing/test_html.py
traceback path.local.ensure.10
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
traceback path.local.ensure.11
called in /home/johnny/projects/merlinux/py/dist/py/apigen/source/testing/test_html.py
traceback path.local.ensure.12
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/genrest.py
traceback path.local.ensure.13
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
traceback path.local.ensure.14
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/testing/test_rest.py
traceback path.local.ensure.15
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py
traceback path.local.ensure.16
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/genrest.py
traceback path.local.ensure.17
called in /home/johnny/projects/merlinux/py/dist/py/documentation/test_conftest.py
traceback path.local.ensure.18
called in /home/johnny/projects/merlinux/py/dist/py/apigen/rest/genrest.py
traceback path.local.ensure.19
called in /home/johnny/projects/merlinux/py/dist/py/test/config.py