#!/usr/bin/env python # testpath.py - Test Driver For tsearchpath.py # Copyright (c) 2010 TundraWare Inc. # For Updates See: http://www.tundraware.com/Software/testpath # Program Information PROGNAME = "testpath" BASENAME = PROGNAME.split(".py")[0] PROGENV = BASENAME.upper() RCSID = "$Id: testpath.py,v 1.101 2010/06/25 14:22:32 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information CPRT = "(c)" DATE = "2010" OWNER = "TundraWare Inc." RIGHTS = "All Rights Reserved." COPYRIGHT = "Copyright %s %s, %s %s" % (CPRT, DATE, OWNER, RIGHTS) PROGVER = PROGNAME + " " + VERSION + (" - %s" % COPYRIGHT) HOMEPAGE = "http://www.tundraware.com/Software/%s\n" % BASENAME #----------------------------------------------------------# # Variables User Might Change # #----------------------------------------------------------# #------------------- Nothing Below Here Should Need Changing ------------------# #----------------------------------------------------------# # Imports # #----------------------------------------------------------# import getopt import os import sys from tsearchpath import * #----------------------------------------------------------# # Aliases & Redefinitions # #----------------------------------------------------------# #----------------------------------------------------------# # Constants & Literals # #----------------------------------------------------------# ##### # Constants ##### #--------------------------- Code Begins Here ---------------------------------# #----------------------------------------------------------# # Object Base Class Definitions # #----------------------------------------------------------# #----------------------------------------------------------# # Supporting Function Definitions # #----------------------------------------------------------# ##### # Print To stdout ##### def PrintStdout(msg, trailing="\n"): sys.stdout.write(msg + trailing) # End of 'PrintStdout' #----------------------------------------------------------# # Program Entry Point # #----------------------------------------------------------# arglen = len(sys.argv) if arglen not in (3, 4): PrintStdout("usage: testpath.py filename searchpath [PATHSEP]") sys.exit(1) else: if arglen == 3: PrintStdout(str(tsearchpath(sys.argv[1], sys.argv[2]))) else: PrintStdout(str(tsearchpath(sys.argv[1], sys.argv[2], PATHDELIM=sys.argv[3])))