Metadata-Version: 2.1
Name: chmod-monkey
Version: 1.1.1
Summary: Add support for `os.chmod('script.sh', 'ug+x')` syntax style.
Home-page: https://github.com/Toilal/python-chmod-monkey
Author: Rémi Alvergnat
Author-email: toilal.dev@gmail.com
License: MIT
Download-URL: https://pypi.python.org/packages/source/g/python-chmod-monkey/python-chmod-monkey-1.1.1.tar.gz
Description: # python-chmod-monkey
        
        [![PyPI](https://img.shields.io/pypi/v/chmod-monkey)](https://pypi.org/project/chmod-monkey/)
        ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/chmod-monkey)
        ![PyPI - License](https://img.shields.io/pypi/l/chmod-monkey)
        [![Build Status](https://img.shields.io/travis/Toilal/python-chmod-monkey.svg)](https://travis-ci.org/Toilal/python-chmod-monkey)
        [![Code coverage](https://img.shields.io/coveralls/github/Toilal/python-chmod-monkey)](https://coveralls.io/github/Toilal/python-chmod-monkey)
        
        Add support for `os.chmod('script.sh', 'ug+x')` syntax style.
        
        Almost any expression supported by [GNU Coreutils chmod](https://linux.die.net/man/1/chmod) should be supported by this module.
        
        **`[ugoa]*([-+=]([rwx]*|[ugo]))+|[-+=][0-7]+`**
        
        `Xst` flags are not supported though.
        
        ## Install
        
        ```
        pip install chmod-monkey
        ```
        
        ## Usage
        
        There are two ways to use `chmod-monkey`.
        
        ### Using os.chmod MonkeyPatch
        
        ```python
        import os
        
        import chmod_monkey
        chmod_monkey.install()  # Install monkeypatch because we are evil !
        
        os.chmod('script.sh', 'ug+x')  # Magic :)
        ```
        
        ### Using to_mode converter
        
        ```python
        import os
        
        from chmod_monkey import to_mode
        
        os.chmod('script.sh', to_mode('script.sh', 'ug+x'))  # For serious people.
        ```
        
        ## Other features
        
        ### Context manager
        
        You may use the following syntax to temporary change a file mode.
        
        ```python
        from chmod_monkey import tmp_chmod
        
        with tmp_chmod('script.sh', "+w"):
            pass # File permissions are modified in this block only
        # File permissions are restored here
        ```
        
        
        History
        =======
        
        1.1.1 (2020-05-12)
        ------------------
        
        - Add `exception_in_context` option to `tmp_chmod` and more data in context manager.
        
        
        1.1.0 (2020-05-12)
        ------------------
        
        - Add `tmp_chmod` function to temporary apply a permission on a file in a `with` statement.
        
        
        1.0.0 (2020-05-11)
        ------------------
        
        - First version
        
Keywords: chmod monkeypatch str string
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Provides-Extra: dev
