Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 427a54b4a369b160f9d0ce76fdd72bb3cd89f142 1 parent f94f055
Adrian Holovaty authored May 05, 2006

Showing 1 changed file with 9 additions and 0 deletions. Show diff stats Hide diff stats

  1. 9  django/core/management.py
9  django/core/management.py
@@ -1045,6 +1045,15 @@ def run_shell(use_plain=False):
1045 1045
         shell.mainloop()
1046 1046
     except ImportError:
1047 1047
         import code
  1048
+        try: # Try activating rlcompleter, because it's handy.
  1049
+            import readline
  1050
+        except ImportError:
  1051
+            pass
  1052
+        else:
  1053
+            # We don't have to wrap the following import in a 'try', because
  1054
+            # we already know 'readline' was imported successfully.
  1055
+            import rlcompleter
  1056
+            readline.parse_and_bind("tab:complete")
1048 1057
         code.interact()
1049 1058
 run_shell.args = '[--plain]'
1050 1059
 

0 notes on commit 427a54b

Please sign in to comment.
Something went wrong with that request. Please try again.