diff --git a/twander.py b/twander.py index 1732d58..4536960 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ # For Updates See: http://www.tundraware.com/Software/twander PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.42 2003/01/03 20:45:53 tundra Exp $" +RCSID = "$Id: twander.py,v 2.43 2003/01/04 19:00:50 tundra Exp $" VERSION = RCSID.split()[2] @@ -41,7 +41,7 @@ from win32api import GetLogicalDriveStrings as GetDrives except: def GetDrives(): - return [] + return "" if OSNAME == 'posix': @@ -241,7 +241,6 @@ # Configuration File Related Literals ##### - ASSIGN = "=" # Assignment for variable definitions CONF = "" # Config file user selected with -c option COMMENT = r"#" # Comment introducer string @@ -335,10 +334,10 @@ # List of internal program variables to dump during debug sessions -DebugVars = ["RCSID","OSNAME", "STARTDIR", "HOME", "CONF", "HEIGHT", "WIDTH", - "BCOLOR", "FCOLOR", "FNAME", "FSZ", "FWT", "AUTOREFRESH", - "DEBUGLEVEL", "WARN", "PSEP", "QUOTECHAR", "POLLINT", - "REFRESHINT", "DriveList"] +DebugVars = ["RCSID", "OSNAME", "HOSTNAME", "OPTIONS", "STARTDIR", "HOME", "CONF", + "HEIGHT", "WIDTH", "BCOLOR", "FCOLOR", "FNAME", "FSZ", + "FWT", "AUTOREFRESH", "DEBUGLEVEL", "WARN", "PSEP", + "QUOTECHAR", "POLLINT", "REFRESHINT", "DriveList"] ##### @@ -569,9 +568,8 @@ # Split what's left into separate fields again fields = line.split() - # Make a copy of the fields guaranteed to have - # at least two fields for use in the variable - # declaration tests. + # Make a copy of the fields which is guaranteed to have at + # least two fields for use in the variable declaration tests. dummy = fields[:] dummy.append("") @@ -787,10 +785,10 @@ ##### def Usage(): - ustring ="" - + for x in uTable: print x + # End of 'Usage()' @@ -861,7 +859,7 @@ self.vSB.pack(side=RIGHT, fill=Y) self.DirList.pack(side=LEFT, fill=BOTH, expand=1) - # End if method 'twanderUI.__init__()' + # End of method 'twanderUI.__init__()' ##### @@ -1052,7 +1050,7 @@ # name. - if details: + if self.DetailsOn: self.NameFirst = ST_SZTOTAL else: self.NameFirst = 0 @@ -1899,10 +1897,16 @@ # Program Entry Point # #----------------------------------------------------------# -# Command line processing +# Command line processing - Process any options set in the +# environment first, and then those given on the command line + +OPTIONS = sys.argv[1:] +envopt = os.getenv(PROGNAME.upper()) +if envopt: + OPTIONS = envopt.split() + OPTIONS try: - opts, args = getopt.getopt(sys.argv[1:], '-b:c:d:f:hn:qrs:tvw:x:y:') + opts, args = getopt.getopt(OPTIONS, '-b:c:d:f:hn:qrs:tvw:x:y:') except getopt.GetoptError: Usage() sys.exit(1)