DebugClients/Python3/FlexCompleter.py

changeset 2953
703452a2876f
parent 945
8cd4d08fa9f6
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 """ 3 """
4 Word completion for the eric5 shell 4 Word completion for the eric5 shell.
5 5
6 <h4>NOTE for eric5 variant</h4> 6 <h4>NOTE for eric5 variant</h4>
7 7
8 This version is a re-implementation of rlcompleter 8 This version is a re-implementation of rlcompleter
9 as found in the Python3 library. It is modified to work with the eric5 9 as found in the Python3 library. It is modified to work with the eric5
72 readline via the set_completer() call: 72 readline via the set_completer() call:
73 73
74 readline.set_completer(Completer(my_namespace).complete) 74 readline.set_completer(Completer(my_namespace).complete)
75 75
76 @param namespace The namespace for the completer. 76 @param namespace The namespace for the completer.
77 """ 77 @exception TypeError raised to indicate a wrong data structure of
78 78 the namespace object
79 """
79 if namespace and type(namespace) != type({}): 80 if namespace and type(namespace) != type({}):
80 raise TypeError('namespace must be a dictionary') 81 raise TypeError('namespace must be a dictionary')
81 82
82 # Don't bind to namespace quite yet, but flag whether the user wants a 83 # Don't bind to namespace quite yet, but flag whether the user wants a
83 # specific namespace or to use __main__.__dict__. This will allow us 84 # specific namespace or to use __main__.__dict__. This will allow us

eric ide

mercurial