Skip to content

Commit 0d46303

Browse files
committed
fix indentation and add author
1 parent 2e63c61 commit 0d46303

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Other contributors are (in alphabetical order):
1010
* Martha Girdler <martha at cheezburger dot com>
1111
* Eike Hein <sho at eikehein dot com>
1212
* Allison Kaptur <allison dot kaptur at gmail dot com>
13+
* Jason Laster <jason dot laster dot 11 at gmail dot com>
1314
* Brandon Navra <brandon dot navra at gmail dot com>
1415
* Michele Orrù <maker dot py at gmail dot com>
1516
* Pavel Panchekha <pavpanchekha at gmail dot com>

bpython/autocomplete.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The MIT License
22
#
3-
# Copyright (c) 2009-2011 the bpython authors.
3+
# Copyright (c) 2009-2012 the bpython authors.
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -42,33 +42,33 @@ class Autocomplete(rlcompleter.Completer):
4242
"""
4343

4444
def __init__(self, namespace = None, config = None):
45-
rlcompleter.Completer.__init__(self, namespace)
46-
self.locals = namespace
47-
if hasattr(config, 'autocomplete_mode'):
48-
self.autocomplete_mode = config.autocomplete_mode
49-
else:
50-
self.autocomplete_mode = 1
45+
rlcompleter.Completer.__init__(self, namespace)
46+
self.locals = namespace
47+
if hasattr(config, 'autocomplete_mode'):
48+
self.autocomplete_mode = config.autocomplete_mode
49+
else:
50+
self.autocomplete_mode = 1
5151

5252
def attr_matches(self, text):
53-
"""Taken from rlcompleter.py and bent to my will.
54-
"""
53+
"""Taken from rlcompleter.py and bent to my will.
54+
"""
5555

56-
# Gna, Py 2.6's rlcompleter searches for __call__ inside the
57-
# instance instead of the type, so we monkeypatch to prevent
58-
# side-effects (__getattr__/__getattribute__)
59-
m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
60-
if not m:
61-
return []
56+
# Gna, Py 2.6's rlcompleter searches for __call__ inside the
57+
# instance instead of the type, so we monkeypatch to prevent
58+
# side-effects (__getattr__/__getattribute__)
59+
m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
60+
if not m:
61+
return []
6262

63-
expr, attr = m.group(1, 3)
64-
if expr.isdigit():
65-
# Special case: float literal, using attrs here will result in
66-
# a SyntaxError
67-
return []
68-
obj = eval(expr, self.locals)
69-
with inspection.AttrCleaner(obj):
70-
matches = self.attr_lookup(obj, expr, attr)
71-
return matches
63+
expr, attr = m.group(1, 3)
64+
if expr.isdigit():
65+
# Special case: float literal, using attrs here will result in
66+
# a SyntaxError
67+
return []
68+
obj = eval(expr, self.locals)
69+
with inspection.AttrCleaner(obj):
70+
matches = self.attr_lookup(obj, expr, attr)
71+
return matches
7272

7373
def attr_lookup(self, obj, expr, attr):
7474
"""Second half of original attr_matches method factored out so it can

0 commit comments

Comments
 (0)