Metadata-Version: 2.1
Name: safer
Version: 0.9.4
Summary: Try to import all modules below a given root
Home-page: https://github.com/rec/safer
Author: Tom Ritchford
Author-email: tom@swirly.com
License: MIT
Keywords: testing,modules
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities

✏️safer ✏️
----------------------

Safely write or print to a file, leaving it unchanged if something goes wrong.

Example:

.. code-block:: python

   import safer

   with safer.writer(filename) as fp:
       for line in source():
          fp.write('this and that')

   with safer.printer(filename) as print:
       print('this', 'and', 'that')
       print('two', 'lines', sep='\n')
       # ...

Writes occur on a temporary file, which is only copied over the original file
when the block completes successfully, so ``safer`` will temporarily use
as much disk space as the old file and the new file put together.

This is great for writing any files which you don't want to get partially
overwritten if something goes wrong in the writing process.


