mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-24 09:21:08 +00:00
lp-shell: use ipython shell if available
suggest ipython and when available use it instead of the regular python shell
This commit is contained in:
parent
5762512710
commit
3449fc6a64
2
debian/control
vendored
2
debian/control
vendored
@ -57,7 +57,7 @@ Recommends: bzr,
|
||||
python-gnupginterface,
|
||||
python-soappy,
|
||||
reportbug (>= 3.39ubuntu1)
|
||||
Suggests: python-simplejson | python (>= 2.7), qemu-user-static
|
||||
Suggests: ipython, python-simplejson | python (>= 2.7), qemu-user-static
|
||||
Description: useful tools for Ubuntu developers
|
||||
This is a collection of useful tools that Ubuntu developers use to make their
|
||||
packaging work a lot easier.
|
||||
|
11
lp-shell
11
lp-shell
@ -63,6 +63,17 @@ def main():
|
||||
|
||||
banner += '\nNote: LP can be accessed through the "lp" object.'
|
||||
|
||||
try:
|
||||
try: # ipython >= 0.11
|
||||
from IPython.frontend.terminal.embed import InteractiveShellEmbed
|
||||
sh = InteractiveShellEmbed(banner2=banner, user_ns={'lp': launchpad})
|
||||
except ImportError: # ipython < 0.11
|
||||
from IPython.Shell import IPShellEmbed
|
||||
sh = IPShellEmbed(user_ns={'lp': launchpad})
|
||||
sh.set_banner(sh.IP.BANNER + '\n' + banner)
|
||||
sh.excepthook = sys.__excepthook__
|
||||
sh()
|
||||
except ImportError:
|
||||
class CompleterConsole(code.InteractiveConsole):
|
||||
def __init__(self):
|
||||
local = {'lp': launchpad}
|
||||
|
Loading…
x
Reference in New Issue
Block a user