dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/32533 ) Change subject: fix_ipy ...................................................................... fix_ipy Change-Id: Ibc0e18b002a03ed17933be4d0b4f4e86ad99c26e --- M pySim-shell.py M requirements.txt 2 files changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/32533/1 diff --git a/pySim-shell.py b/pySim-shell.py index 3b874d0..1897895 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -24,6 +24,7 @@ import cmd2 from cmd2 import style, fg +from packaging import version from cmd2 import CommandSet, with_default_category, with_argparser import argparse @@ -133,8 +134,14 @@ CUSTOM_CATEGORY = 'pySim Commands' def __init__(self, card, rs, sl, ch, script=None): + if version.parse(cmd2.__version__) < version.parse("2.0.0"): + print("USE IPYTHON!") + kwargs = {'use_ipython': True} + else: + kwargs = {'include_ipy': True} + super().__init__(persistent_history_file='~/.pysim_shell_history', allow_cli_args=False, - use_ipython=True, auto_load_commands=False, startup_script=script) + auto_load_commands=False, startup_script=script, **kwargs) self.intro = style('Welcome to pySim-shell!', fg=fg.red) self.default_category = 'pySim-shell built-in commands' self.card = None diff --git a/requirements.txt b/requirements.txt index 4144a1c..bfdbd62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ termcolor colorlog pycryptodome +packaging -- To view, visit https://gerrit.osmocom.org/c/pysim/+/32533 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ibc0e18b002a03ed17933be4d0b4f4e86ad99c26e Gerrit-Change-Number: 32533 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier@sysmocom.de> Gerrit-MessageType: newchange