diff --git a/twander.py b/twander.py index 667c75b..70364a2 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.191 2005/02/02 09:39:08 tundra Exp $" +RCSID = "$Id: twander.py,v 3.192 2005/02/02 10:12:43 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -608,11 +608,12 @@ # Variable Name Pattern Matching Stuff DIRSC = "DIRSC" # Directory Shortcut naming -WILDCARD = "WILDCARD" # Wildcard naming reDIRSC = r'^' + DIRSC + r'([1-9]|1[0-2])$' # Regex describing Directory Shortcut names -rePROMPT = r'\+{PROMPT:.*?\}' # Regex describing prompt builtin +rePROMPT = r'\+{PROMPT:.*?\}' # Regex describing prompt builtin reVAR = r"\[.+?\]" # Regex describing variable notation reYESNO = r'\{YESNO:.*?\}' # Regex describing yes or no builtin +WILDFILTER = "WILDFILTER" # Configuration statement for pre-loading Filter list +WILDSELECT = "WILDSELECT" # Configuration statement for pre-loading Selection list # Create actual regex matching engines @@ -1606,7 +1607,11 @@ # Process any wildcard definitions - elif name == WILDCARD: + elif name == WILDFILTER: + if val and (val not in UI.FilterHist): + UpdateMenu(UI.FilterBtn, UI.FilterHist, MAXMENU, MAXMENUBUF, KeyFilterWild, newentry=val, fakeevent=True) + + elif name == WILDSELECT: if val and (val not in UI.SelectHist): UpdateMenu(UI.SelectBtn, UI.SelectHist, MAXMENU, MAXMENUBUF, KeySelWild, newentry=val, fakeevent=True) @@ -1742,7 +1747,7 @@ UpdateMenu(UI.DirBtn, UI.AllDirs, MAXMENU, MAXMENUBUF, LoadDirList, sort=True) UpdateMenu(UI.HistBtn, UI.CmdHist, MAXMENU, MAXMENUBUF, KeyRunCommand, fakeevent=True) - UpdateMenu(UI.FilterBtn, UI.FilterHist, MAXMENU, MAXMENUBUF, KeyFiltWild, fakeevent=True) + UpdateMenu(UI.FilterBtn, UI.FilterHist, MAXMENU, MAXMENUBUF, KeyFilterWild, fakeevent=True) UpdateMenu(UI.SelectBtn, UI.SelectHist, MAXMENU, MAXMENUBUF, KeySelWild, fakeevent=True) # Initialize the Sorting Menu @@ -2280,7 +2285,7 @@ self.DirList.bind(self.KeyBindings["MOUSEWILDSEL"], MouseClick) # Bind handler for "Filter With Wildcard" - self.DirList.bind(self.KeyBindings["FILTERWILD"], KeyFiltWild) + self.DirList.bind(self.KeyBindings["FILTERWILD"], KeyFilterWild) # Bind handler for "Select With Wildcard" self.DirList.bind(self.KeyBindings["SELWILD"], KeySelWild) @@ -3062,7 +3067,7 @@ # Event Handler: Filter Using Wildcard ##### -def KeyFiltWild(event, initial=""): +def KeyFilterWild(event, initial=""): global UI prompt = pWILDFILT @@ -3123,7 +3128,7 @@ # Add this wildcard to the menu if its not there already if uwc not in UI.FilterHist: - UpdateMenu(UI.FilterBtn, UI.FilterHist, MAXMENU, MAXMENUBUF, KeyFiltWild, newentry=uwc, fakeevent=True) + UpdateMenu(UI.FilterBtn, UI.FilterHist, MAXMENU, MAXMENUBUF, KeyFilterWild, newentry=uwc, fakeevent=True) # Dump wildcard stack if debug requested it if DEBUGLEVEL & DEBUGWILD: @@ -3131,7 +3136,7 @@ return 'break' -# End of 'KeyFiltWild()' +# End of 'KeyFilterWild()' #####