Minor changes to python_pgm_template
Change-Id: Ia27858a0b3d45fba263c1b6725f8c2271231f12c
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/templates/python_pgm_template b/templates/python_pgm_template
index fc2cf79..12e80ce 100644
--- a/templates/python_pgm_template
+++ b/templates/python_pgm_template
@@ -1,18 +1,8 @@
#!/usr/bin/env python
-r"""
-See help text for details.
-"""
-
-import sys
-
-save_dir_path = sys.path.pop(0)
-
-modules = ['gen_arg', 'gen_print', 'gen_valid']
-for module in modules:
- exec("from " + module + " import *")
-
-sys.path.insert(0, save_dir_path)
+from gen_print import *
+from gen_arg import *
+from gen_valid import *
parser = argparse.ArgumentParser(
usage='%(prog)s [OPTIONS]',
@@ -31,22 +21,21 @@
def exit_function():
r"""
- Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT).
+ 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().
"""
- # This function will be called by gen_exit_function(). If you have no cleanup to do, you can delete
- # this function altogether.
+ # If you have no cleanup to do, you can delete this function altogether.
# Your cleanup code here.
def validate_parms():
r"""
- Validate program parameters, etc.
+ Validate program parameters, etc. This function will be called by gen_setup().
"""
- # This function will be called by gen_setup(). If you have no validation to do, you can delete this
- # function altogether.
+ # If you have no validation to do, you can delete this function altogether.
# Your validation code here...
# valid_value(whatever)