Show More
@@ -46,25 +46,11 b' Notes:' | |||
|
46 | 46 | used, and this module (and the readline module) are silently inactive. |
|
47 | 47 | """ |
|
48 | 48 | |
|
49 | #***************************************************************************** | |
|
49 | # Copyright (c) IPython Development Team. | |
|
50 | # Distributed under the terms of the Modified BSD License. | |
|
50 | 51 | # |
|
51 | # Since this file is essentially a minimally modified copy of the rlcompleter | |
|
52 | # module which is part of the standard Python distribution, I assume that the | |
|
53 | # proper procedure is to maintain its copyright as belonging to the Python | |
|
54 | # Software Foundation (in addition to my own, for all new code). | |
|
55 | # | |
|
56 | # Copyright (C) 2008 IPython Development Team | |
|
57 | # Copyright (C) 2001 Fernando Perez. <fperez@colorado.edu> | |
|
58 | # Copyright (C) 2001 Python Software Foundation, www.python.org | |
|
59 | # | |
|
60 | # Distributed under the terms of the BSD License. The full license is in | |
|
61 | # the file COPYING, distributed as part of this software. | |
|
62 | # | |
|
63 | #***************************************************************************** | |
|
64 | ||
|
65 | #----------------------------------------------------------------------------- | |
|
66 | # Imports | |
|
67 | #----------------------------------------------------------------------------- | |
|
52 | # Some of this code originated from rlcompleter in the Python standard library | |
|
53 | # Copyright (C) 2001 Python Software Foundation, www.python.org | |
|
68 | 54 | |
|
69 | 55 | import __main__ |
|
70 | 56 | import glob |
@@ -735,7 +721,7 b' class IPCompleter(Completer):' | |||
|
735 | 721 | else: |
|
736 | 722 | # true if txt is _not_ a _ name, false otherwise: |
|
737 | 723 | no__name = (lambda txt: |
|
738 |
re.match(r' |
|
|
724 | re.match(r'\._.*?',txt[txt.rindex('.'):]) is None) | |
|
739 | 725 | matches = filter(no__name, matches) |
|
740 | 726 | except NameError: |
|
741 | 727 | # catches <undefined attributes>.<tab> |
@@ -222,6 +222,7 b' def test_omit__names():' | |||
|
222 | 222 | # also happens to test IPCompleter as a configurable |
|
223 | 223 | ip = get_ipython() |
|
224 | 224 | ip._hidden_attr = 1 |
|
225 | ip._x = {} | |
|
225 | 226 | c = ip.Completer |
|
226 | 227 | ip.ex('ip=get_ipython()') |
|
227 | 228 | cfg = Config() |
@@ -240,6 +241,8 b' def test_omit__names():' | |||
|
240 | 241 | s,matches = c.complete('ip.') |
|
241 | 242 | nt.assert_not_in('ip.__str__', matches) |
|
242 | 243 | nt.assert_not_in('ip._hidden_attr', matches) |
|
244 | s,matches = c.complete('ip._x.') | |
|
245 | nt.assert_in('ip._x.keys', matches) | |
|
243 | 246 | del ip._hidden_attr |
|
244 | 247 | |
|
245 | 248 |
General Comments 0
You need to be logged in to leave comments.
Login now