| |
---|
| | import sys |
---|
| | |
---|
| | # Version info |
---|
| | |
---|
| | VERSION = "$Id: tdir,v 1.53 2001/06/24 01:29:15 tundra Exp $" |
---|
| | VERSION = "$Id: tdir,v 1.54 2001/06/24 01:35:50 tundra Exp $" |
---|
| | |
---|
| | |
---|
| | # Booleans |
---|
| | |
---|
| |
---|
| | |
---|
| | RECURSE = FALSE # No recursion |
---|
| | SHOWDIR = TRUE # Show directories in listing |
---|
| | SHOWFILE = TRUE # Show files in listing |
---|
| | TREE = FALSE # Don't just show the directory tree |
---|
| | |
---|
| | |
---|
| | def OrderByExtension(list): |
---|
| | ExtList = {} |
---|
| | ExtList[""] = [] # List of files with no extension |
---|
| |
---|
| | |
---|
| | |
---|
| | def DisplayOutput(dir, DirList, FileList): |
---|
| | sys.stdout.write(dir.replace("\\", "/") + ":" + "\n") |
---|
| | if not TREE: |
---|
| | if SHOWDIR or SHOWFILE : |
---|
| | sys.stdout.write("\n") |
---|
| | if len(DirList) > 0: |
---|
| | DirList.sort() |
---|
| | OutputColumns(DirList, TRUE) |
---|
| |
---|
| | if opt == "-t": |
---|
| | RECURSE = TRUE |
---|
| | SHOWDIR = FALSE |
---|
| | SHOWFILE = FALSE |
---|
| | TREE = TRUE |
---|
| | if opt == "-v": |
---|
| | sys.stdout.write(VERSION + "\n") |
---|
| | sys.exit(0) |
---|
| | if opt == "-w": |
---|
| |
---|
| | |