diff --git a/twander.py b/twander.py index 9923bfb..d2db799 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ PROGNAME = "twander" -RCSID = "$Id: twander.py,v 1.59 2002/11/17 09:06:50 tundra Exp $" +RCSID = "$Id: twander.py,v 1.60 2002/11/17 19:46:08 tundra Exp $" VERSION = RCSID.split()[2] @@ -823,7 +823,6 @@ ##### def RefreshDirList(*args): - rm_list = [] # After we fiddle with things we want to # restore the currently selected item as such. @@ -840,33 +839,12 @@ active=UI.DirList.index(ACTIVE) - # Confirm that everything in the DirList widget - # is still present in the directory. If not, - # remove it from the widget. + # Clear out the old contents + UI.DirList.delete(0,END) - for i in range(UI.DirList.index(END)): - - # Get entry - x = UI.DirList.get(i) - - # First strip any directory delimiters - if x[0] == DIR_LDELIM and x[-1] == DIR_RDELIM: - x = x[1:-1] - - # Make list of items which no longer exist in this directory - # Ignore '..', since it always exists - - if x != '..': - if not os.path.exists(UI.CurrentDir + x): - rm_list.append(i) - - # Now actually delete these items from the listbox - - for i in rm_list: - UI.DirList.delete(i) - - # Update it visually - UI.DirList.pack() + # Reload current directory contents into UI + for x in BuildDirList(UI.CurrentDir): + UI.DirList.insert(END, x) # Restore current selection and active entry # Make sure they are still in range singe we