fixeria submitted this change.
osmo-s1gw-cli.py: fix default category name with newer cmd2
Change-Id: Ib2b5ef325cfc379db65a627d219caadd41c255d5
---
M contrib/osmo-s1gw-cli.py
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py
index 0249d5e..bcfd812 100755
--- a/contrib/osmo-s1gw-cli.py
+++ b/contrib/osmo-s1gw-cli.py
@@ -185,7 +185,10 @@
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'
+ if hasattr(cmd2.Cmd, 'DEFAULT_CATEGORY'): # newer cmd2
+ cmd2.Cmd.DEFAULT_CATEGORY = 'Built-in commands'
+ else: # older cmd2 (e.g. 2.x)
+ self.default_category = 'Built-in commands'
self.prompt = 'OsmoS1GW# '
self.tablefmt = 'github' # default table format for tabulate
To view, visit change 44037. To unsubscribe, or for help writing mail filters, visit settings.