diff --git a/twander.py b/twander.py index b52d844..0f7e52d 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ PROGNAME = "twander" -RCSID = "$Id: twander.py,v 1.36 2002/11/09 19:54:29 tundra Exp $" +RCSID = "$Id: twander.py,v 1.37 2002/11/09 20:30:49 tundra Exp $" VERSION = RCSID.split()[2] @@ -86,8 +86,8 @@ # General Literals ##### -DIR_LDELIM = '<' # Directory left dsply. delimiter -DIR_RDELIM = '>' # Directory left dsply. delimiter +DIR_LDELIM = '[' # Directory left dsply. delimiter +DIR_RDELIM = ']' # Directory left dsply. delimiter PSEP = os.sep # Character separating path components @@ -111,7 +111,7 @@ ##### eBADROOT = " %s Is Not A Directory" -eDIRRD = " Problem Reading Directory : %s" +eDIRRD = "Cannot Open Directory : %s --- Check Permissions." eDUPKEY = "Duplicate Key In Configuration File Found In Entry: \'%s\'" eERROR = "ERROR" eNOCONF = "Cannot Find Configuration File: %s" @@ -181,7 +181,6 @@ def BuildDirList(ROOTDIR): dList, fList = [], [] - dList.append(DIR_LDELIM + ".." + DIR_RDELIM) # Always show one directory up try: for file in os.listdir(ROOTDIR): @@ -193,6 +192,14 @@ ErrMsg(eDIRRD % ROOTDIR) dList.sort() + + # Entry to move up one directory is always first, + # no matter what the sort. This is necessary because + # OSs like Win32 like to use '$' in file names which + # sorts before "." + + dList.insert(0, DIR_LDELIM + ".." + DIR_RDELIM) + fList.sort() return dList + fList @@ -214,6 +221,11 @@ ##### def LoadDirList(): + global ROOTDIR + + # Canonicalize the current directory name + ROOTDIR = os.path.abspath(ROOTDIR) + # Update the window title UIroot.title(PROGNAME + " " + VERSION + " " + ROOTDIR) @@ -500,10 +512,6 @@ rcfile = {} ParseRC() -# Canonicalize the ROOTDIR -ROOTDIR = os.path.abspath(ROOTDIR) - - # Create an instance of the UI UIroot = Tk() UI = twanderUI(UIroot)