diff --git a/twander.py b/twander.py index 2162604..fde9d12 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 1.91 2002/12/09 17:35:41 tundra Exp $" +RCSID = "$Id: twander.py,v 1.92 2002/12/09 18:37:39 tundra Exp $" VERSION = RCSID.split()[2] @@ -379,8 +379,16 @@ # Dump tables if we're debugging if DEBUG: - print "SYMBOL TABLE: ", UI.SymTable - print "COMMAND TABLE: ", UI.CmdTable + print "SYMBOL TABLE:\n" + for sym in UI.SymTable.keys(): + print sym + " " * (16-len(sym)) + UI.SymTable[sym] + + print"\nCOMMAND TABLE:\n" + for key in UI.CmdTable.keys(): + name = UI.CmdTable[key][0] + cmd = UI.CmdTable[key][1] + print key + " " + name + " " * (16-len(name)) + cmd + # End of 'ParseConfFile()' @@ -437,7 +445,7 @@ else: cmdkey = fields[0] cmdname = fields[1] - cmd = line.split(fields[1])[1].strip() + cmd = " ".join(fields[2:]) # Evaluate the command line, replacing # variables as needed @@ -694,6 +702,7 @@ ##### def LastInSelection(self): + index = self.DirList.curselection() if index: return self.DirList.get(index[-1])[UI.NameFirst:].split(SYMPTR)[0] @@ -799,14 +808,21 @@ if cmd: # Replace runtime-determined tokens - cmd = cmd.replace(SELECTION, UI.LastInSelection()) + selection = UI.LastInSelection() - fstring = "" + selections = "" for selected in UI.AllSelection(): - fstring += selected + " " + selections += selected + " " + + dselections = "" + for sel in selections.split(): + dselections += UI.CurrentDir + sel + " " - cmd = cmd.replace(SELECTIONS, fstring) cmd = cmd.replace(DIR, UI.CurrentDir) + cmd = cmd.replace(DSELECTION, UI.CurrentDir + selection) + cmd = cmd.replace(DSELECTIONS, dselections) + cmd = cmd.replace(SELECTION, selection) + cmd = cmd.replace(SELECTIONS, selections) # Just dump command if we're debugging