diff options
| author | jvoisin | 2018-04-04 23:21:48 +0200 |
|---|---|---|
| committer | jvoisin | 2018-04-04 23:21:48 +0200 |
| commit | 0239ab3b6a6ae38dbf5ba439f91f0cee498711a9 (patch) | |
| tree | 19159991a5fe0d504ebbd2396800a9a1fda38a09 /main.py | |
| parent | 9fa76c4c2038a776cc94af5d9f307bbaad52083c (diff) | |
Add some white lines to make the code more compliant
Diffstat (limited to 'main.py')
| -rwxr-xr-x | main.py | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -16,6 +16,7 @@ def __check_file(filename:str, mode:int = os.R_OK) -> bool: | |||
| 16 | return False | 16 | return False |
| 17 | return True | 17 | return True |
| 18 | 18 | ||
| 19 | |||
| 19 | def create_arg_parser(): | 20 | def create_arg_parser(): |
| 20 | parser = argparse.ArgumentParser(description='Metadata anonymisation toolkit 2') | 21 | parser = argparse.ArgumentParser(description='Metadata anonymisation toolkit 2') |
| 21 | parser.add_argument('files', nargs='*') | 22 | parser.add_argument('files', nargs='*') |
| @@ -29,6 +30,7 @@ def create_arg_parser(): | |||
| 29 | help='list all the harmful metadata of a file without removing them') | 30 | help='list all the harmful metadata of a file without removing them') |
| 30 | return parser | 31 | return parser |
| 31 | 32 | ||
| 33 | |||
| 32 | def show_meta(filename:str): | 34 | def show_meta(filename:str): |
| 33 | if not __check_file(filename): | 35 | if not __check_file(filename): |
| 34 | return | 36 | return |
| @@ -44,6 +46,7 @@ def show_meta(filename:str): | |||
| 44 | except UnicodeEncodeError: | 46 | except UnicodeEncodeError: |
| 45 | print(" %s: harmful content" % k) | 47 | print(" %s: harmful content" % k) |
| 46 | 48 | ||
| 49 | |||
| 47 | def clean_meta(filename:str): | 50 | def clean_meta(filename:str): |
| 48 | if not __check_file(filename, os.R_OK|os.W_OK): | 51 | if not __check_file(filename, os.R_OK|os.W_OK): |
| 49 | return | 52 | return |
| @@ -54,6 +57,7 @@ def clean_meta(filename:str): | |||
| 54 | return | 57 | return |
| 55 | p.remove_all() | 58 | p.remove_all() |
| 56 | 59 | ||
| 60 | |||
| 57 | def show_parsers(): | 61 | def show_parsers(): |
| 58 | print('[+] Supported formats:') | 62 | print('[+] Supported formats:') |
| 59 | for parser in parser_factory._get_parsers(): | 63 | for parser in parser_factory._get_parsers(): |
| @@ -61,6 +65,7 @@ def show_parsers(): | |||
| 61 | extensions = ', '.join(mimetypes.guess_all_extensions(mtype)) | 65 | extensions = ', '.join(mimetypes.guess_all_extensions(mtype)) |
| 62 | print(' - %s (%s)' % (mtype, extensions)) | 66 | print(' - %s (%s)' % (mtype, extensions)) |
| 63 | 67 | ||
| 68 | |||
| 64 | def __get_files_recursively(files): | 69 | def __get_files_recursively(files): |
| 65 | for f in files: | 70 | for f in files: |
| 66 | if os.path.isfile(f): | 71 | if os.path.isfile(f): |
