1#!/usr/bin/env python
2
3r"""
4See help text for details.
5"""
6
7import sys
8
9save_dir_path = sys.path.pop(0)
10
11modules = ['gen_arg', 'gen_print', 'gen_valid']
12for module in modules:
13    exec("from " + module + " import *")
14
15sys.path.insert(0, save_dir_path)
16
17parser = argparse.ArgumentParser(
18    usage='%(prog)s [OPTIONS]',
19    description="%(prog)s will...",
20    formatter_class=argparse.ArgumentDefaultsHelpFormatter,
21    prefix_chars='-+')
22
23parser.add_argument(
24    '--whatever',
25    default='',
26    help='bla, bla.')
27
28# Populate stock_list with options we want.
29stock_list = [("test_mode", 0), ("quiet", 0), ("debug", 0)]
30
31
32def exit_function(signal_number=0,
33                  frame=None):
34    r"""
35    Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT).
36    """
37
38    # This function will be called by gen_exit_function().  If you have no cleanup to do, you can delete
39    # this function altogether.
40
41    # Your cleanup code here.
42
43
44def validate_parms():
45    r"""
46    Validate program parameters, etc.
47    """
48
49    # This function will be called by gen_setup().  If you have no validation to do, you can delete this
50    # function altogether.
51
52    # Your validation code here...
53    # valid_value(whatever)
54
55
56def main():
57
58    gen_setup()
59
60    # Your code here.
61
62
63main()
64