[XS] Change in ...osmo-s1gw[master]: osmo-s1gw-cli.py: fix compatibility with newer cmd2
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/44036?usp=email ) Change subject: osmo-s1gw-cli.py: fix compatibility with newer cmd2 ...................................................................... osmo-s1gw-cli.py: fix compatibility with newer cmd2 Change-Id: I9ebe107b12f2e9e9a55441e58a9992405dc76bc2 --- M contrib/osmo-s1gw-cli.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/36/44036/1 diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index 12079be..0249d5e 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -180,7 +180,11 @@ logging.root.setLevel(logging.DEBUG) self.debug = True - self.intro = cmd2.style('Welcome to %s!' % self.DESC, fg=cmd2.Fg.RED) + intro = 'Welcome to %s!' % self.DESC + if hasattr(cmd2, 'stylize'): # newer cmd2 (rich based) + self.intro = cmd2.stylize(intro, cmd2.Color.RED) + else: # older cmd2 (e.g. 2.x) + self.intro = cmd2.style(intro, fg=cmd2.Fg.RED) self.default_category = 'Built-in commands' self.prompt = 'OsmoS1GW# ' -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/44036?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I9ebe107b12f2e9e9a55441e58a9992405dc76bc2 Gerrit-Change-Number: 44036 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
participants (1)
-
fixeria