diff --git a/twander.py b/twander.py index c451cf7..5587c67 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ PROGNAME = "twander" -RCSID = "$Id: twander.py,v 1.31 2002/11/08 23:39:12 tundra Exp $" +RCSID = "$Id: twander.py,v 1.32 2002/11/09 00:31:08 tundra Exp $" VERSION = RCSID.split()[2] @@ -104,15 +104,19 @@ ##### uTable = [PROGNAME + " " + VERSION + " - Copyright 2002, TundraWare Inc., All Rights Reserved\n", - "usage: " + PROGNAME + " [-d dir] [-hv] [starting directory] where,\n", + "usage: " + PROGNAME + " [-d dir] [-hv] [startdir] where,\n", " startdir name of directory in which to begin (default: current dir)", + " -b color background color", " -c file name of configuration file (default: " + CONFFILE + ")", + " -f color foreground color", " -h print this help information", + " -n name name of font to use", + " -s size size of font to use", " -v print detailed version information", + " -w wght weight/style of font to use", ] - ##### # Prompts ##### @@ -328,22 +332,51 @@ # Command line processing try: - opts, args = getopt.getopt(sys.argv[1:], '-c:hv') + opts, args = getopt.getopt(sys.argv[1:], '-b:c:f:hn:s:vw:') except getopt.GetoptError: Usage() sys.exit(1) +# Defaults + +# Configuration file conf = CONFFILE + +# Starting directory rootdir = "." + PSEP + +# Colors +bcolor = "black" +fcolor = "green" + +# Fonts + +fname = "Courier" +fsz = 12 +fwt = "bold" + + +# Parse command line + for opt, val in opts: + if opt == "-b": + bcolor = val if opt == "-c": conf = val + if opt == "-f": + fcolor = val if opt == "-h": Usage() sys.exit(0) + if opt == "-n": + fname = val + if opt == "-s": + fsz = val if opt == "-v": print RCSID sys.exit(0) + if opt == "-w": + fwt = val # Can only have 0 or 1 arguments # Make sure any starting directory argument is legit @@ -379,7 +412,13 @@ UIroot = Tk() SB = Scrollbar(UIroot, orient=VERTICAL) -DirList = Listbox(selectmode=SINGLE, exportselection=0, yscrollcommand=SB.set) +DirList = Listbox(UIroot, + foreground = fcolor, + background = bcolor, + font = (fname, fsz, fwt), + selectmode=SINGLE, + exportselection=0, + yscrollcommand=SB.set) SB.config(command=DirList.yview) SB.pack(side=RIGHT, fill=Y)