diff --git a/tdir b/tdir index 1511891..2cdf226 100755 --- a/tdir +++ b/tdir @@ -1,4 +1,4 @@ -#!/usr//bin/env python +#!/usr//bin/env python2 """ tdir - Display Formatted Directory Listings Copyright (c) 2001-2014 TundraWare Inc., All Rights Reserved. @@ -43,7 +43,7 @@ except: pass - + if not cr: cr = (env.get('LINES', 25), env.get('COLUMNS', 80)) @@ -52,7 +52,7 @@ # cr = (env['LINES'], env['COLUMNS']) #except: # cr = (25, 80) - + return int(cr[1]), int(cr[0]) # End of 'GetTerminalSize()' @@ -100,7 +100,7 @@ ext = "" name = x ExtList[ext].append(name) - + return ExtList @@ -123,7 +123,7 @@ sys.stdout.write(x + (COLWIDTH - len(x)) * PAD) col += 1 sys.stdout.write("\n\n") - + def DisplayOutput(dir, DirList, FileList): if (dir[-1] != "/") and (dir[-1] != "\\"): @@ -151,9 +151,9 @@ else: FileList.sort() OutputColumns(FileList, False) - - + + def BuildFileList (args, dir, files): DirList = [] FileList = [] @@ -172,7 +172,7 @@ def Usage(): - UsageInfo = ( + UsageInfo = ( ("tdir " + VERSION.split()[2] + " - Copyright (c) 2001-2014 TundraWare Inc., All Rights Reserved. \n", ""), (" usage: tdir [-DRdefhtv] [-c #] [-s c] [-w #] [dir...] where,\n\n", ""), @@ -204,7 +204,7 @@ except getopt.GetoptError: Usage() sys.exit(2) - + for opt, val in opts: if opt == "-D": SHOWDOT = False @@ -236,7 +236,7 @@ if OWIDTH < COLWIDTH: sys.stdout.write("Huh? Column width exceeds output width!\n") sys.exit(2) - + TWIDTH = COLWIDTH - 1 # Text width MAXCOL, INDENT = divmod(OWIDTH, COLWIDTH) # No of output cols & indent @@ -246,7 +246,7 @@ for root in args: if not os.path.isdir(root): sys.stdout.write(root + " is not a directory!\n") - sys.exit(2) + sys.exit(2) if RECURSE: os.path.walk(root, BuildFileList, None) else: