| |
---|
| | |
---|
| | # Program Information |
---|
| | |
---|
| | PROGNAME = "tconfpy" |
---|
| | RCSID = "$Id: tconfpy.py,v 1.0 2003/12/13 01:00:28 tundra Exp $" |
---|
| | RCSID = "$Id: tconfpy.py,v 1.100 2004/03/09 08:00:01 tundra Exp $" |
---|
| | VERSION = RCSID.split()[2] |
---|
| | |
---|
| | # Copyright Information |
---|
| | |
---|
| | CPRT = chr(169) |
---|
| | DATE = "2003-2004" |
---|
| | OWNER = "TundraWare Inc." |
---|
| | RIGHTS = "All Rights Reserved" |
---|
| | COPYRIGHT = "Copyright %s %s %s %s. " % (CPRT, DATE, OWNER, RIGHTS) |
---|
| | COPYRIGHT = "Copyright %s %s %s, %s." % (CPRT, DATE, OWNER, RIGHTS) |
---|
| | PROGINFO = PROGNAME + " " + VERSION |
---|
| | BANNER = "%s - %s" % (PROGINFO, COPYRIGHT) |
---|
| | |
---|
| | |
---|
| | #----------------------------------------------------------# |
---|
| | # Variables User Might Change # |
---|
| |
---|
| | #----------------------------------------------------------# |
---|
| | |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | ########## |
---|
| | # Constants |
---|
| | ##### |
---|
| | ########## |
---|
| | |
---|
| | FALSE = 0 == 1 # Booleans |
---|
| | TRUE = not FALSE |
---|
| | MSGCOL = 10 # Column to start message output |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | ########## |
---|
| | # Literals |
---|
| | ##### |
---|
| | ########## |
---|
| | |
---|
| | |
---|
| | #----------------------------------------------------------# |
---|
| | # Prompts, & Application Strings # |
---|
| | #----------------------------------------------------------# |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | ########## |
---|
| | # Error Messages |
---|
| | ##### |
---|
| | ########## |
---|
| | |
---|
| | eERROR = "ERROR" |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | ########## |
---|
| | # Informational Messages |
---|
| | ##### |
---|
| | ########## |
---|
| | |
---|
| | iERRTST = "Test Error Message - Ignore" |
---|
| | iWARNTST = "Test Warning Message Ignore" |
---|
| | |
---|
| | |
---|
| | ########## |
---|
| | # Prompts |
---|
| | ########## |
---|
| | |
---|
| | ##### |
---|
| | # Prompts |
---|
| | ##### |
---|
| | |
---|
| | ########## |
---|
| | # Warning Messages |
---|
| | ########## |
---|
| | |
---|
| | wWARNING = "WARNING" |
---|
| | |
---|
| | |
---|
| | |
---|
| | #----------------------------------------------------------# |
---|
| |
---|
| | # Supporting Function Definitions # |
---|
| | #----------------------------------------------------------# |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | # Print An Error Message |
---|
| | ##### |
---|
| | ########## |
---|
| | # Create An Error Message |
---|
| | ########## |
---|
| | |
---|
| | def errmsg(emsg): |
---|
| | print PROGINFO + " " + eERROR + ": " + emsg |
---|
| | def ErrorMsg(error): |
---|
| | |
---|
| | return mkmsg(error + "!", eERROR) |
---|
| | |
---|
| | # End of 'errmsg()' |
---|
| | # End of 'ErrorMsg()' |
---|
| | |
---|
| | |
---|
| | ##### |
---|
| | # Run This When Directly Invoked Instead Of Imported |
---|
| | ##### |
---|
| | ########## |
---|
| | # Construct A Standard Application Message String |
---|
| | ########## |
---|
| | |
---|
| | def direct(): |
---|
| | print PROGINFO |
---|
| | print COPYRIGHT |
---|
| | errmsg("Test Error Message Function") |
---|
| | def mkmsg(msg, msgtype=""): |
---|
| | |
---|
| | if msgtype: |
---|
| | sep = ":" |
---|
| | |
---|
| | pad = " " * (MSGCOL - len(msgtype)) |
---|
| | |
---|
| | return "%s - %s%s%s%s" % (PROGINFO, msgtype,sep, pad, msg) |
---|
| | |
---|
| | # End of 'mkmsg()' |
---|
| | |
---|
| | |
---|
| | ########## |
---|
| | # Create A Warning Message |
---|
| | ########## |
---|
| | |
---|
| | def WarningMsg(warning): |
---|
| | |
---|
| | return mkmsg(warning + "!", wWARNING) |
---|
| | |
---|
| | # End of 'WarningMsg()' |
---|
| | |
---|
| | |
---|
| | #----------------------------------------------------------# |
---|
| | # Entry Point # |
---|
| | #----------------------------------------------------------# |
---|
| | |
---|
| | if __name__ == '__main__': |
---|
| | direct() |
---|
| | |
---|
| | print BANNER |
---|
| | print ErrorMsg(iERRTST) |
---|
| | print WarningMsg(iWARNTST) |
---|
| | |
---|
| | |
---|
| | |
---|
| | |