<commit_before>permset
=======

Simple standalone utility script to manage *nix permissions on file and directory trees based on patterns<commit_msg>another try<commit_after>permset
=======

Simple standalone utility script to manage \*nix permissions on file and directory trees based
on patterns.

Installation
------------
### Easiest:
    
    pip install permset

### Standard python distutils
 * download latest release from http://pypi.python.org/pypi/permset
 * unpack
 * go to folder
 * python setup.py install

### Standalone script
Download, rename and make executable (in some PATH folder, e.g. ~/bin):

    wget https://raw.github.com/trebor74hr/permset/master/permset/base.py
    mv base.py permset
    chmod u+x permset

Try:

    ./permset

Requirements
------------

* \*nix (linux, osx, bsd, unix ...).
* Python 2.6+ (json module used).


Usage
-----

Usage:

    permset [options] [<dir>]

### Arguments:

* when <dir> is not specified, current folder is used (.)
* script uses <dir>/.permset to save/check against permission setup.
* when no options is set - script calculates patterns and prints them
  out.  If <dir>/.permset exists - calculated patterns and saved patterns
  are compared.

### Options

Options:

    -h, --help             show this help message and exit
    -o FILE, --output=FILE where to write output perm.setup to FILE. Option sets
                           save option too.
    -s, --save             save perm.setup to new file or overwrite existing
    -t, --set              set permissions by actual perm.setup
    -v, --verbose          verbose output


Common workflow 
---------------
Common workflow:

1. calculate permission patterns (permset), save them to root/.permset
   (permset --save)
2. When desired, compare current permissions with saved patterns 
   (permset), if any difference found, apply patterns (permset --set) 
   or overwrite existing patterns with new one (permset --save)


Pattern codes by columns
------------------------
Pattern codes by columns:

1. D - directory pattern, F - files pattern
2. P - is pattern, S - single file/directory
3. if pattern: R - recursive, L - current directory only
4. mark - user|group|permission
5. file/directory the entry applies to
6. (opt) file/directory depth - 0 is the root

Example session
---------------
TODO

Logic behind patterns
---------------------
TODO
dirs!=files
recursive, local, single
formula


Development
-----------

Issue reporting
---------------

Licence and disclaimer
----------------------
Licence and disclaimer in [LICENCE]
(https://github.com/trebor74hr/permset/blob/master/LICENCE) file.
{'fraction_non_alphanumeric': 0.14220532319391635, 'fraction_numerical': 0.005703422053231939, 'mean_word_length': 2.4755614266842803, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2156466', 'n_tokens_mistral': 747, 'n_tokens_neox': 719, 'n_words': 294}