fixeria has submitted this change. ( 
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(-)

Approvals:
  pespin: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




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: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I9ebe107b12f2e9e9a55441e58a9992405dc76bc2
Gerrit-Change-Number: 44036
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to