| 472 | # assigned below to one of these functions. |
| 473 | |
| 474 | def _complete_location(self, text, line, begidx, endidx): |
| 475 | # Complete a file/module/function location for break/tbreak/clear. |
| 476 | if line.strip().endswith((':', ',')): |
| 477 | # Here comes a line number or a condition which we can't complete. |
| 478 | return [] |
| 479 | # First, try to find matching functions (i.e. expressions). |
| 480 | try: |
| 481 | ret = self._complete_expression(text, line, begidx, endidx) |
| 482 | except Exception: |
| 483 | ret = [] |
| 484 | # Then, try to complete file names as well. |
| 485 | globs = glob.glob(text + '*') |
| 486 | for fn in globs: |
| 487 | if os.path.isdir(fn): |
| 488 | ret.append(fn + '/') |
| 489 | elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')): |
| 490 | ret.append(fn + ':') |
| 491 | return ret |
| 492 | |
| 493 | def _complete_bpnumber(self, text, line, begidx, endidx): |
| 494 | # Complete a breakpoint number. (This would be more helpful if we could |