|
74 | 74 | def after_last_dot(name): |
75 | 75 | return name.rstrip('.').rsplit('.')[-1] |
76 | 76 |
|
| 77 | + |
77 | 78 | def few_enough_underscores(current, match): |
78 | 79 | """Returns whether match should be shown based on current |
79 | 80 |
|
@@ -139,8 +140,9 @@ def matches(self, cursor_offset, line, **kwargs): |
139 | 140 | def locate(self, cursor_offset, line): |
140 | 141 | """Returns a Linepart namedtuple instance or None given cursor and line |
141 | 142 |
|
142 | | - A Linepart namedtuple contains a start, stop, and word. None is returned |
143 | | - if no target for this type of completion is found under the cursor.""" |
| 143 | + A Linepart namedtuple contains a start, stop, and word. None is |
| 144 | + returned if no target for this type of completion is found under |
| 145 | + the cursor.""" |
144 | 146 | raise NotImplementedError |
145 | 147 |
|
146 | 148 | def format(self, word): |
@@ -240,7 +242,7 @@ def locate(self, current_offset, line): |
240 | 242 | def format(self, filename): |
241 | 243 | filename.rstrip(os.sep).rsplit(os.sep)[-1] |
242 | 244 | if os.sep in filename[:-1]: |
243 | | - return filename[filename.rindex(os.sep, 0, -1)+1:] |
| 245 | + return filename[filename.rindex(os.sep, 0, -1) + 1:] |
244 | 246 | else: |
245 | 247 | return filename |
246 | 248 |
|
@@ -474,12 +476,10 @@ def matches(self, cursor_offset, line, **kwargs): |
474 | 476 | except EvaluationError: |
475 | 477 | return set() |
476 | 478 | with inspection.AttrCleaner(obj): |
477 | | - # strips leading dot |
| 479 | + # strips leading dot |
478 | 480 | matches = [m[1:] for m in self.attr_lookup(obj, '', attr.word)] |
479 | 481 |
|
480 | | - |
481 | 482 | return set(m for m in matches if few_enough_underscores(attr.word, m)) |
482 | | - return matches |
483 | 483 |
|
484 | 484 |
|
485 | 485 | try: |
@@ -517,7 +517,7 @@ def matches(self, cursor_offset, line, **kwargs): |
517 | 517 | self._orig_start = None |
518 | 518 | return None |
519 | 519 |
|
520 | | - first_letter = line[self._orig_start:self._orig_start+1] |
| 520 | + first_letter = line[self._orig_start:self._orig_start + 1] |
521 | 521 |
|
522 | 522 | matches = [c.name for c in completions] |
523 | 523 | if any(not m.lower().startswith(matches[0][0].lower()) |
|
0 commit comments