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(): 33 r""" 34 Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). 35 """ 36 37 # This function will be called by gen_exit_function(). If you have no cleanup to do, you can delete 38 # this function altogether. 39 40 # Your cleanup code here. 41 42 43def validate_parms(): 44 r""" 45 Validate program parameters, etc. 46 """ 47 48 # This function will be called by gen_setup(). If you have no validation to do, you can delete this 49 # function altogether. 50 51 # Your validation code here... 52 # valid_value(whatever) 53 54 55def main(): 56 57 gen_setup() 58 59 # Your code here. 60 61 62main() 63