diff --git a/twander.py b/twander.py index 4bbf103..7233e02 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.153 2005/01/07 23:51:50 tundra Exp $" +RCSID = "$Id: twander.py,v 3.154 2005/01/08 02:08:02 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -285,6 +285,7 @@ SORTBYFIELD = "Name" # Field to use as sort key SORTREVERSE = FALSE # Reverse specified sort order? SORTSEPARATE = TRUE # Separate Directories and Files in sorted displays? +SYMDIR = TRUE # Sort symlinks pointing to directories as directories USETHREADS = FALSE # Use threads on Unix? USEWIN32ALL = TRUE # Use win32all features if available? WARN = TRUE # Warnings on? @@ -3485,8 +3486,9 @@ # Add trailing path separator to directory entries + # Pay attention to pickup symlinks pointing to directories - if detail[0] == ST_SPECIALS["04"]: + if detail[0] == ST_SPECIALS["04"] or (SYMDIR and os.path.isdir(detail.split(SYMPTR)[-1].strip())): file += PSEP detail += PSEP @@ -3516,11 +3518,12 @@ # Keep track of the file name and its details, separating directories from files + # Treat symlinks pointing to directories as directories for this purpose # Build corresponding key list for sorting fileinfo.append((file, detail)) - if detail[0] == ST_SPECIALS["04"]: + if detail[0] == ST_SPECIALS["04"] or (SYMDIR and os.path.isdir(detail.split(SYMPTR)[-1].strip())): dKeys.setdefault(sortkey, []).append(x) else: @@ -4536,6 +4539,7 @@ "NODETAILS":NODETAILS, "NONAVIGATE":NONAVIGATE, "SORTREVERSE":SORTREVERSE, "SORTSEPARATE":SORTSEPARATE, + "SYMDIR":SYMDIR, "USETHREADS":USETHREADS, "USEWIN32ALL":USEWIN32ALL, "WARN":WARN}