| 63 | return rlcompleter.Completer._callable_postfix(self, val, word) |
| 64 | |
| 65 | def global_matches(self, text): |
| 66 | names = rlcompleter.Completer.global_matches(self, text) |
| 67 | prefix = commonprefix(names) |
| 68 | if prefix and prefix != text: |
| 69 | return [prefix] |
| 70 | |
| 71 | names.sort() |
| 72 | values = [] |
| 73 | for name in names: |
| 74 | clean_name = name.rstrip(': ') |
| 75 | if keyword.iskeyword(clean_name) or keyword.issoftkeyword(clean_name): |
| 76 | values.append(None) |
| 77 | else: |
| 78 | try: |
| 79 | values.append(eval(name, self.namespace)) |
| 80 | except Exception: |
| 81 | values.append(None) |
| 82 | if self.use_colors and names: |
| 83 | return self.colorize_matches(names, values) |
| 84 | return names |
| 85 | |
| 86 | def attr_matches(self, text): |
| 87 | try: |