Ticket #25536: 100644.diff

File 100644.diff, 1.5 KB (added by Matheus Rosa, 9 years ago)

Diff file

  • django/core/management/commands/shell.py

    diff --git i/django/core/management/commands/shell.py w/django/core/management/commands/shell.py
    index d8bded0..e52af95 100644
    i w from django.core.management.base import BaseCommand  
    44
    55
    66class Command(BaseCommand):
    7     help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available."
     7    help = "Runs a Python interactive interpreter. Tries to use IPython, bpython or ptpython, if one of them is available."
    88    requires_system_checks = False
    9     shells = ['ipython', 'bpython']
     9    shells = ['ipython', 'bpython', 'ptpython']
    1010
    1111    def add_arguments(self, parser):
    1212        parser.add_argument('--plain', action='store_true', dest='plain',
    13             help='Tells Django to use plain Python, not IPython or bpython.')
     13            help='Tells Django to use plain Python, not IPython, bpython or ptpython.')
    1414        parser.add_argument('--no-startup', action='store_true', dest='no_startup',
    1515            help='When using plain Python, ignore the PYTHONSTARTUP environment variable and ~/.pythonrc.py script.')
    1616        parser.add_argument('-i', '--interface', choices=self.shells, dest='interface',
    class Command(BaseCommand):  
    5050        import bpython
    5151        bpython.embed()
    5252
     53    def ptpython(self):
     54        from ptpython.repl import embed
     55        embed(globals(), locals())
     56
    5357    def run_shell(self, shell=None):
    5458        available_shells = [shell] if shell else self.shells
    5559
Back to Top