| parser = argparse.ArgumentParser( |
| usage='%(prog)s [OPTIONS]', |
| description="%(prog)s will...", |
| formatter_class=argparse.ArgumentDefaultsHelpFormatter, |
| # Populate stock_list with options we want. |
| stock_list = [("test_mode", 0), ("quiet", 0), ("debug", 0)] |
| Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). This |
| function will be called by gen_exit_function(). |
| # If you have no cleanup to do, you can delete this function altogether. |
| # Your cleanup code here. |
| Validate program parameters, etc. This function will be called by gen_setup(). |
| # If you have no validation to do, you can delete this function altogether. |
| # Your validation code here... |