summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-05 03:17:51 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-05 03:17:51 +0000
commit427a54b4a369b160f9d0ce76fdd72bb3cd89f142 (patch)
tree5fc9c2a35037714eed5835c8d6627f75312cb364
parentf94f0555bcf98e8b05874dfa3c804393ff4b91f4 (diff)
Fixed #1719 -- Added rlcompleter autocompletion to 'manage.py shell' if IPython is not used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2842 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/django/core/management.py b/django/core/management.py
index ea995bbd7a..d2a620772b 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1045,6 +1045,15 @@ def run_shell(use_plain=False):
shell.mainloop()
except ImportError:
import code
+ try: # Try activating rlcompleter, because it's handy.
+ import readline
+ except ImportError:
+ pass
+ else:
+ # We don't have to wrap the following import in a 'try', because
+ # we already know 'readline' was imported successfully.
+ import rlcompleter
+ readline.parse_and_bind("tab:complete")
code.interact()
run_shell.args = '[--plain]'