Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Create, yield, and finally delete a temporary directory.

>>> from rst2rst.utils.tempdir import temporary_directory
>>> import os
>>> with temporary_directory() as directory:
...     os.path.isdir(directory)
True
>>> os.path.exists(directory)
False
(more...)

src/r/s/rst2rst-HEAD/rst2rst/tests/test_fixtures.py   rst2rst(Download)
from docutils.core import publish_string
 
from rst2rst.utils.tempdir import temporary_directory
 
 
                     'ten_input.txt')
        expected_names = ['two', 'four-five-six']  # Order does not matter.
        with temporary_directory() as directory:
            for filename in filenames:  # Create the files.
                open(os.path.join(directory, filename), 'w').write('fake')