Changeset 29801 in vbox
- Timestamp:
- May 26, 2010 8:24:47 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r29800 r29801 188 188 return False 189 189 190 def canBePath(self,phrase,word): 191 return word.startswith('/') 192 190 193 def canBeMachine(self,phrase,word): 191 return not self.canBeCommand(phrase, word) 194 return not self.canBePath(phrase,word) and not self.canBeCommand(phrase, word) 195 196 def canBePath(self,phrase,word): 197 return word.startswith('/') 192 198 193 199 def global_matches(self, text): … … 199 205 200 206 matches = [] 201 n = len(text)202 207 phrase = readline.get_line_buffer() 203 208 204 if self.canBeCommand(phrase,text):205 for list in [ self.namespace ]:206 for word in list:207 if word[:n] == text:208 matches.append(word)209 209 try: 210 if self.canBeCommand(phrase,text): 211 n = len(text) 212 for list in [ self.namespace ]: 213 for word in list: 214 if word[:n] == text: 215 matches.append(word) 216 210 217 if self.canBeMachine(phrase,text): 218 n = len(text) 211 219 for m in getMachines(self.ctx, False, True): 212 220 # although it has autoconversion, we need to cast … … 216 224 matches.append(word) 217 225 word = str(m.id) 218 if word[0] == '{':219 word = word[1:-1]220 226 if word[:n] == text: 221 227 matches.append(word) 228 229 if self.canBePath(phrase,text): 230 (dir,rest) = os.path.split(text) 231 n = len(rest) 232 for word in os.listdir(dir): 233 if n == 0 or word[:n] == rest: 234 matches.append(os.path.join(dir,word)) 235 222 236 except Exception,e: 223 237 printErr(e)
Note:
See TracChangeset
for help on using the changeset viewer.