diff --git a/common/program_header b/common/program_header index a08a451..bddbdc7 100755 --- a/common/program_header +++ b/common/program_header @@ -1,5 +1,5 @@ #!__INTERPRETER__ -# __PROJECTNAME__.__TYPE__ - __DESCRIPTION__ +# __FULLNAME__ - __DESCRIPTION__ # __COPYRIGHT__ # __RESERVED__ # __UPDATES__ diff --git a/py/program.py b/py/program.py index a3d9ce4..50dd1f4 100755 --- a/py/program.py +++ b/py/program.py @@ -2,8 +2,8 @@ # Program Information ##### -PROGNAME = "__PROJECTNAME__" -PROGENV = PROGNAME.upper() +PROGNAME = "__FULLNAME__" +PROGENV = "__PROJECTNAME__".upper() VERSION = CVSID.split()[2] ##### @@ -13,8 +13,7 @@ COPYRIGHT = "__COPYRIGHT__" -PROGVER = PROGNAME + " " + VERSION + (" - %s" % COPYRIGHT) -HOMEPAGE = "__WEBSITE__" +PROGVER = PROGNAME + " " + VERSION + " - __DESCRIPTION__" #----------------------------------------------------------# @@ -97,7 +96,6 @@ ##### uTable = [PROGVER, - HOMEPAGE, "usage: " + PROGNAME + " [-fhv]", " where,", " -f file configuration file to use", @@ -110,7 +108,7 @@ # Global Variables & Data Structures # #----------------------------------------------------------# -CFGFILE = os.path.join(os.getenv("HOME"), "." + PROGNAME) # conf file +CFGFILE = os.path.join(os.getenv("HOME"), "." + "__PROJECTNAME__") # conf file #--------------------------- Code Begins Here ---------------------------------# @@ -233,30 +231,41 @@ try: opts, args = getopt.getopt(OPTIONS, '-f:hv') + except getopt.GetoptError as e: + ErrorMsg(eBADARG % e.args[0]) sys.exit(1) for opt, val in opts: + if opt == "-f": CFGFILE=val + if opt == "-h": Usage() sys.exit(0) + if opt == "-v": print CVSID sys.exit(0) +# Processing of the configuration file below requires installation of +# the freely available TundraWare Inc. 'tconfpy' parser and then +# uncommenting the code below. The parser can be found at: +# +# http://www.tundraware.com/Software/tconfpy +# # Process the configuration file - -retval = tconfpy.ParseConfig(CFGFILE, CallingProgram="%s %s " % (PROGNAME, VERSION)) - +# +#retval = tconfpy.ParseConfig(CFGFILE, CallingProgram="%s %s " % (PROGNAME, VERSION)) +# # Print any errors or warning generated by the parse - -for x in (retval.ErrMsgs, retval.WarnMsgs): - for y in x: - print y - +# +# for x in (retval.ErrMsgs, retval.WarnMsgs): +# for y in x: +# print y +# # If there were any errors, we're done -if retval.ErrMsgs: - sys.exit(0) +#if retval.ErrMsgs: +# sys.exit(0) diff --git a/sh/program.sh b/sh/program.sh index cb3d116..26cf0ed 100755 --- a/sh/program.sh +++ b/sh/program.sh @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # COPYRIGHT="__COPYRIGHT__" -PROGNAME="__PROJECTNAME__" +VERSION=`echo ${CVSID} | cut -d " " -f 3` # -------------------------------------------------------------------------- # @@ -38,8 +38,8 @@ # Program Related Stuff ##### -HELPTEXT="${CVSID} \n\ - Usage: ${PROGNAME} -XYZh \n\ +HELPTEXT="__FULLNAME__ ${VERSION} - __DESCRIPTION__ \n\ + Usage: __FULLNAME__ -XYZh \n\ where, \n\ \n\ -X Option X \n\ @@ -205,6 +205,18 @@ case ${cl_argument} in + -X) + PrintMsg "You have selected option: X" + ;; + + -Y) + PrintMsg "You have selected option: Y" + ;; + + -Z) + PrintMsg "You have selected option: Z" + ;; + -h) Usage exit diff --git a/tmkproject.rst b/tmkproject.rst index 8f404a9..e37f341 100644 --- a/tmkproject.rst +++ b/tmkproject.rst @@ -75,6 +75,14 @@ You also need a modern version of ``make``, like the one from the GNU project. Old BSD type ``make`` utilities will not work. +The ``python`` skeleton includes code to parse a configuration file +using the TundraWare Inc. ``tconfpy`` parser. ``tconfpy`` is not +included in the ``tmkproject`` package distribution, hence +configuration file handling is commented out in the ``python`` code +skeleton. If you wish to use ``tconfpy``, it is freely available at:: + + http://www.tundraware.com/Software/tconfpy + BRANDING & CUSTOMIZATION ------------------------ @@ -191,6 +199,7 @@ __EDITOR__ Name of editor (.tmkproject) __EDITARGS__ Editor arguments (.tmkproject) __EMAILSUPPORT__ Email support address (.tmkproject) + __FULLNAME__ The full name of the program w/type suffix __ID__ CVS version string, ``$Id`` (internal) __INTERPRETER__ "Hash bang" string for the selected language. __LANGUAGE__ Name of the language (internal) @@ -256,7 +265,7 @@ :: - $Id: tmkproject.rst,v 1.120 2012/06/07 14:31:29 tundra Exp $ + $Id: tmkproject.rst,v 1.121 2012/06/07 17:00:39 tundra Exp $ You can find the latest version of this program at: diff --git a/tokens b/tokens index 6ca3c6b..dc0c258 100644 --- a/tokens +++ b/tokens @@ -5,6 +5,7 @@ __EDITOR__ "${EDITOR}" __EDITARGS__ "${EDITARGS}" __EMAILSUPPORT__ "${EMAILSUPPORT}" +__FULLNAME__ "${PROJECTNAME}.${TYPE}" __ID__ \\$Id\\$ __INTERPRETER__ "${INTERPRETER}" __LANGUAGE__ "${LANGUAGE}"