diff options
| author | jvoisin | 2011-07-30 21:47:31 +0200 |
|---|---|---|
| committer | jvoisin | 2011-07-30 21:47:31 +0200 |
| commit | 5715ba52f2238af513b0b87f4aa3c0158d2c84ba (patch) | |
| tree | e77829efd78b1473650a669546c3c11edc37932c /cli.py | |
| parent | c9cb00bdf702ce6663e78784de63dc6d35c3d875 (diff) | |
Documentation, and removal of unnecessary imports
Diffstat (limited to 'cli.py')
| -rwxr-xr-x | cli.py | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -12,6 +12,9 @@ __version__ = '0.1' | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | def parse(): | 14 | def parse(): |
| 15 | ''' | ||
| 16 | Get, and parse options passed to the program | ||
| 17 | ''' | ||
| 15 | parser = optparse.OptionParser(usage='%prog [options] filename') | 18 | parser = optparse.OptionParser(usage='%prog [options] filename') |
| 16 | parser.add_option('--add2archive', '-a', action='store_true', | 19 | parser.add_option('--add2archive', '-a', action='store_true', |
| 17 | default=False, help='Add to outputed archive non-supported filetypes') | 20 | default=False, help='Add to outputed archive non-supported filetypes') |
| @@ -33,7 +36,10 @@ def parse(): | |||
| 33 | return values, arguments | 36 | return values, arguments |
| 34 | 37 | ||
| 35 | 38 | ||
| 36 | def display_version(*args): | 39 | def display_version(*_): |
| 40 | ''' | ||
| 41 | Display the program's version, and exit | ||
| 42 | ''' | ||
| 37 | print('Metadata Anonymisation Toolkit version %s') % mat.__version__ | 43 | print('Metadata Anonymisation Toolkit version %s') % mat.__version__ |
| 38 | print('CLI version %s') % __version__ | 44 | print('CLI version %s') % __version__ |
| 39 | print('Hachoir version %s') % hachoir_core.__version__ | 45 | print('Hachoir version %s') % hachoir_core.__version__ |
| @@ -87,6 +93,9 @@ def clean_meta_ugly(class_file, filename): | |||
| 87 | 93 | ||
| 88 | 94 | ||
| 89 | def main(): | 95 | def main(): |
| 96 | ''' | ||
| 97 | main function : get args, and launch the appropriate function | ||
| 98 | ''' | ||
| 90 | args, filenames = parse() | 99 | args, filenames = parse() |
| 91 | 100 | ||
| 92 | #func receive the function correponding to the options given as parameters | 101 | #func receive the function correponding to the options given as parameters |
