diff --git a/twander.py b/twander.py index 762e10b..e58fe92 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ # For Updates See: http://www.tundraware.com/Software/twander PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.64 2003/01/17 06:23:01 tundra Exp $" +RCSID = "$Id: twander.py,v 2.65 2003/01/17 06:55:46 tundra Exp $" VERSION = RCSID.split()[2] @@ -170,6 +170,8 @@ AUTOREFRESH = TRUE # Automatically refresh the directory display DEBUGLEVEL = 0 # No debug output +NODETAILS = FALSE # TRUE means details can never be displayed +NONAVIGATE = FALSE # TRUE means that all directory navigation is prevented WARN = TRUE # Warnings on ##### @@ -270,6 +272,7 @@ ##### ASSIGN = "=" # Assignment for variable definitions + CONF = "" # Config file user selected with -c option COMMENT = r"#" # Comment introducer string ENVVBL = r'$' # Symbol denoting an environment variable @@ -383,7 +386,7 @@ DebugVars = ["RCSID", "OSNAME", "HOSTNAME", "OPTIONS", "STARTDIR", "HOME", "CONF", "HEIGHT", "WIDTH", "BCOLOR", "FCOLOR", "FNAME", "FSZ", "FWT", "MAXDIR", "MAXHIST", "MAXNESTING", "AUTOREFRESH", "DEBUGLEVEL", "WARN", "PSEP", - "QUOTECHAR", "POLLINT", "REFRESHINT"] + "QUOTECHAR", "POLLINT", "REFRESHINT", "NODETAILS", "NONAVIGATE"] ##### @@ -1086,7 +1089,11 @@ def SetDetailedView(self, details): - self.DetailsOn = details + # See if we're forcing details to always be off + if NODETAILS: + self.DetailsOn = FALSE + else: + self.DetailsOn = details # Tell system where actual file name begins # For both choices below, we have to set the UI.NameFirst @@ -1832,6 +1839,10 @@ def LoadDirList(newdir, save=TRUE): + # Make sure we're permitted to navigate - we have to allow initial entry into STARTDIR + if NONAVIGATE and (newdir != STARTDIR): + return + # Transform double forward-slashes into a single # forward-slash. This keeps the Directory Stack # and Visited lists sane under Unix and prevents @@ -2454,6 +2465,9 @@ def ProcessOptions(): global UI + # Start in detailed mode unless details are inhibited + UI.SetDetailedView(~NODETAILS) + # Rebind all the handlers UI.BindAllHandlers() @@ -2569,7 +2583,7 @@ # Options which can be set in the configuration file -UI.OptionsBoolean = ["AUTOREFRESH", "WARN"] +UI.OptionsBoolean = ["AUTOREFRESH", "NODETAILS", "NONAVIGATE", "WARN"] UI.OptionsNumeric = ["DEBUGLEVEL", "FSZ", "HEIGHT", "MAXDIR", "MAXHIST", "MAXNESTING", "REFRESHINT", "WIDTH"] UI.OptionsString = ["BCOLOR", "FCOLOR", "FNAME", "FWT", "QUOTECHAR", "STARTDIR"] @@ -2716,9 +2730,6 @@ # Initialize the polling counter UI.ElapsedTime = 0 -# Start in detailed mode -UI.SetDetailedView(TRUE) - # Initialize the UI directory listing LoadDirList(STARTDIR) KeySelTop(None)