Adding a shortcut for pecan shell config.py --shell=XXX.

This commit is contained in:
Ryan Petrello
2012-03-20 19:25:28 -04:00
parent 8cb08af541
commit d2b835c242
3 changed files with 7 additions and 4 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -78,7 +78,10 @@ class CommandRunner(object):
)
for arg in getattr(cmd, 'arguments', tuple()):
arg = arg.copy()
sub.add_argument(arg.pop('command'), **arg)
if isinstance(arg.get('command'), basestring):
sub.add_argument(arg.pop('command'), **arg)
elif isinstance(arg.get('command'), list):
sub.add_argument(*arg.pop('command'), **arg)
def run(self, args):
ns = self.parser.parse_args(args)

View File

@@ -10,7 +10,7 @@ import sys
class NativePythonShell(object):
@classmethod
def invoke(cls, ns, banner):
def invoke(cls, ns, banner): # pragma: nocover
import code
py_prefix = sys.platform.startswith('java') and 'J' or 'P'
shell_banner = 'Pecan Interactive Shell\n%sython %s\n\n' % \
@@ -26,7 +26,7 @@ class NativePythonShell(object):
class IPythonShell(object):
@classmethod
def invoke(cls, ns, banner):
def invoke(cls, ns, banner): # pragma: nocover
try:
from IPython.frontend.terminal.embed import (
InteractiveShellEmbed
@@ -51,7 +51,7 @@ class ShellCommand(BaseCommand):
}
arguments = BaseCommand.arguments + ({
'command': '--shell',
'command': ['--shell', '-s'],
'help': 'which Python shell to use',
'choices': SHELLS.keys(),
'default': 'python'