eric6/DebugClients/Python/FlexCompleter.py

changeset 8217
385f60c94548
parent 8207
d359172d11be
child 8230
8b5c6896655b
equal deleted inserted replaced
8216:6a042a54e0f7 8217:385f60c94548
120 @param val value to check (object) 120 @param val value to check (object)
121 @param word word to ammend (string) 121 @param word word to ammend (string)
122 @return ammended word (string) 122 @return ammended word (string)
123 """ 123 """
124 if callable(val): 124 if callable(val):
125 word = word + "(" 125 word += "("
126 return word 126 return word
127 127
128 def global_matches(self, text): 128 def global_matches(self, text):
129 """ 129 """
130 Public method to compute matches when text is a simple name. 130 Public method to compute matches when text is a simple name.
139 n = len(text) 139 n = len(text)
140 for word in keyword.kwlist: 140 for word in keyword.kwlist:
141 if word[:n] == text: 141 if word[:n] == text:
142 seen.add(word) 142 seen.add(word)
143 if word in {'finally', 'try'}: 143 if word in {'finally', 'try'}:
144 word = word + ':' 144 word += ':'
145 elif word not in {'False', 'None', 'True', 145 elif word not in {'False', 'None', 'True',
146 'break', 'continue', 'pass', 146 'break', 'continue', 'pass',
147 'else'}: 147 'else'}:
148 word = word + ' ' 148 word += ' '
149 matches.append(word) 149 matches.append(word)
150 for nspace in [self.namespace, builtins.__dict__]: 150 for nspace in [self.namespace, builtins.__dict__]:
151 for word, val in nspace.items(): 151 for word, val in nspace.items():
152 if word[:n] == text and word not in seen: 152 if word[:n] == text and word not in seen:
153 seen.add(word) 153 seen.add(word)
225 @return A list of all names defined in the class. 225 @return A list of all names defined in the class.
226 """ 226 """
227 ret = dir(klass) 227 ret = dir(klass)
228 if hasattr(klass, '__bases__'): 228 if hasattr(klass, '__bases__'):
229 for base in klass.__bases__: 229 for base in klass.__bases__:
230 ret = ret + get_class_members(base) 230 ret += get_class_members(base)
231 return ret 231 return ret
232 232
233 # 233 #
234 # eflag: noqa = M111 234 # eflag: noqa = M111

eric ide

mercurial