diff --git a/twander.py b/twander.py index fab909d..68cce2a 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.180 2005/01/28 10:19:42 tundra Exp $" +RCSID = "$Id: twander.py,v 3.181 2005/01/28 11:09:27 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -87,13 +87,13 @@ MOUSEHIST = '' # Pop-up History Menu MOUSESC = '' # Pop-up Shortcut Menu MOUSESORT = '' # Pop-up Sort Menu -MOUSEWILD = '' # Pop-up Wildcard Menu KEYPRESS = '' # Any keypress (for commands) QUITPROG = '' # Quit the program READCONF = '' # Re-read the configuration file REFRESH = '' # Refresh screen TOGAUTO = '' # Toggle autorefreshing TOGDETAIL = '' # Toggle detail view +TOGLENGTH = '' # Toggle length display between actual and normalized TOGWIN32ALL = '' # Toggle win32all features, if available # Directory Navigation @@ -192,6 +192,7 @@ # Wildcard Features +MOUSEWILD = '' # Pop-up Wildcard Menu FILTERWILD = '' # Filter file list with wildcard SELWILD = '' # Select using wildcards @@ -276,7 +277,8 @@ # Defaults ##### -ADAPTREFRESH = True # Dynamically adjust refresh intervals +ACTUALLENGTH = False # Show actual file lengths +ADAPTREFRESH = True # Dynamically adjust refresh intervals AFTERCLEAR = True # Clear all selections following REFRESHAFTER AFTERWAIT = 1 # Seconds to wait before REFRESHAFTER AUTOREFRESH = True # Automatically refresh the directory display? @@ -931,6 +933,9 @@ def FileLength(flen): + if ACTUALLENGTH: + return str(flen) + if flen >= GB: flen = str(flen/GB) + "g" elif flen >= MB: @@ -1012,13 +1017,13 @@ "MOUSEHIST":MOUSEHIST, "MOUSESC":MOUSESC, "MOUSESORT":MOUSESORT, - "MOUSEWILD":MOUSEWILD, "KEYPRESS":KEYPRESS, "QUITPROG":QUITPROG, "READCONF":READCONF, "REFRESH":REFRESH, "TOGAUTO":TOGAUTO, "TOGDETAIL":TOGDETAIL, + "TOGLENGTH":TOGLENGTH, "TOGWIN32ALL":TOGWIN32ALL, "CHANGEDIR":CHANGEDIR, "DIRHOME":DIRHOME, @@ -1090,6 +1095,7 @@ "SORTBYNAME":SORTBYNAME, "SORTREV":SORTREV, "SORTSEP":SORTSEP, + "MOUSEWILD":MOUSEWILD, "FILTERWILD":FILTERWILD, "SELWILD":SELWILD, } @@ -2003,6 +2009,9 @@ # Bind handler for "Toggle Detail" self.DirList.bind(self.KeyBindings["TOGDETAIL"], KeyToggleDetail) + # Bind handler for "Toggle Length Display" + self.DirList.bind(self.KeyBindings["TOGLENGTH"], KeyToggleLength) + # Bind handler for "Toggle win32all Features" self.DirList.bind(self.KeyBindings["TOGWIN32ALL"], KeyToggleWin32All) @@ -2604,6 +2613,20 @@ ##### +# Event Handler: Toggle Normalized Or Actual File Length Display +##### + +def KeyToggleLength(event): + global ACTUALLENGTH + + ACTUALLENGTH = not ACTUALLENGTH + RefreshDirList(event) + return 'break' + +# End of 'KeyToggleLength()' + + +##### # Event Handler: Toggle win32all Features, If Available ##### @@ -4813,7 +4836,8 @@ # Options (and their default values) which can be set in the configuration file -UI.OptionsBoolean = {"ADAPTREFRESH":ADAPTREFRESH, +UI.OptionsBoolean = {"ACTUALLENGTH":ACTUALLENGTH, + "ADAPTREFRESH":ADAPTREFRESH, "AFTERCLEAR":AFTERCLEAR, "AUTOREFRESH":AUTOREFRESH, "FORCEUNIXPATH":FORCEUNIXPATH,