Show More
@@ -95,11 +95,14 b' def runlistpy(self, event):' | |||
|
95 | 95 | comps = shlex.split(event.line) |
|
96 | 96 | relpath = (len(comps) > 1 and comps[-1] or '') |
|
97 | 97 | |
|
98 | print "rp",relpath | |
|
98 | #print "rp",relpath # dbg | |
|
99 | glob = glob.glob | |
|
100 | isdir = os.path.isdir | |
|
99 | 101 | if relpath.startswith('~'): |
|
100 | 102 | relpath = os.path.expanduser(relpath) |
|
101 |
dirs = [f.replace('\\','/') + "/" for f in |
|
|
102 | pys = [f.replace('\\','/') for f in glob.glob(relpath+'*.py')] | |
|
103 | dirs = [f.replace('\\','/') + "/" for f in glob(relpath+'*') | |
|
104 | if isdir(f)] | |
|
105 | pys = [f.replace('\\','/') for f in glob(relpath+'*.py')] | |
|
103 | 106 | return dirs + pys |
|
104 | 107 | |
|
105 | 108 | ip.set_hook('complete_command', runlistpy, str_key = '%run') |
@@ -406,7 +406,9 b' class IPCompleter(Completer):' | |||
|
406 | 406 | # Takes care of links to directories also. Use '/' |
|
407 | 407 | # explicitly, even under Windows, so that name completions |
|
408 | 408 | # don't end up escaped. |
|
409 | matches[0] += '/' | |
|
409 | pjoin = os.path.join | |
|
410 | d = matches[0] | |
|
411 | matches = [ pjoin(d,p) for p in os.listdir(d) ] | |
|
410 | 412 | return matches |
|
411 | 413 | |
|
412 | 414 | def alias_matches(self, text): |
@@ -1,3 +1,10 b'' | |||
|
1 | 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu> | |
|
2 | ||
|
3 | * IPython/completer.py (IPCompleter.file_matches): Fix | |
|
4 | tab-completion so that quotes are not closed unless the completion | |
|
5 | is unambiguous. After a request by Stefan. Minor cleanups in | |
|
6 | ipy_stock_completers. | |
|
7 | ||
|
1 | 8 | 2006-11-02 Ville Vainio <vivainio@gmail.com> |
|
2 | 9 | |
|
3 | 10 | * ipy_stock_completers.py: Add %run and %cd completers. |
General Comments 0
You need to be logged in to leave comments.
Login now