Show More
@@ -95,11 +95,14 b' def runlistpy(self, event):' | |||||
95 | comps = shlex.split(event.line) |
|
95 | comps = shlex.split(event.line) | |
96 | relpath = (len(comps) > 1 and comps[-1] or '') |
|
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 | if relpath.startswith('~'): |
|
101 | if relpath.startswith('~'): | |
100 | relpath = os.path.expanduser(relpath) |
|
102 | relpath = os.path.expanduser(relpath) | |
101 |
dirs = [f.replace('\\','/') + "/" for f in |
|
103 | dirs = [f.replace('\\','/') + "/" for f in glob(relpath+'*') | |
102 | pys = [f.replace('\\','/') for f in glob.glob(relpath+'*.py')] |
|
104 | if isdir(f)] | |
|
105 | pys = [f.replace('\\','/') for f in glob(relpath+'*.py')] | |||
103 | return dirs + pys |
|
106 | return dirs + pys | |
104 |
|
107 | |||
105 | ip.set_hook('complete_command', runlistpy, str_key = '%run') |
|
108 | ip.set_hook('complete_command', runlistpy, str_key = '%run') |
@@ -406,7 +406,9 b' class IPCompleter(Completer):' | |||||
406 | # Takes care of links to directories also. Use '/' |
|
406 | # Takes care of links to directories also. Use '/' | |
407 | # explicitly, even under Windows, so that name completions |
|
407 | # explicitly, even under Windows, so that name completions | |
408 | # don't end up escaped. |
|
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 | return matches |
|
412 | return matches | |
411 |
|
413 | |||
412 | def alias_matches(self, text): |
|
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 | 2006-11-02 Ville Vainio <vivainio@gmail.com> |
|
8 | 2006-11-02 Ville Vainio <vivainio@gmail.com> | |
2 |
|
9 | |||
3 | * ipy_stock_completers.py: Add %run and %cd completers. |
|
10 | * ipy_stock_completers.py: Add %run and %cd completers. |
General Comments 0
You need to be logged in to leave comments.
Login now