summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-06 21:28:06 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-06 21:28:06 -0500
commitede9f3e77a59281a442227ed9b4b92e62e85d2b9 (patch)
treeb87239799cf71c67704d3ffe7bc0879d57056d3e /examples
parentc7ac2e965d025806ce5baddfc718814e3e58d639 (diff)
downloadcmd2-git-ede9f3e77a59281a442227ed9b4b92e62e85d2b9.tar.gz
Added convenience `ansi.fg` and `ansi.bg` enums of foreground and background colors which style() can now optionally use
This is to make it easier to autocomplete color names in an IDE
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/basic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basic.py b/examples/basic.py
index 37db6501..5df3d1b5 100755
--- a/examples/basic.py
+++ b/examples/basic.py
@@ -9,7 +9,7 @@
6) Shell-like capabilities
"""
import cmd2
-from cmd2 import style
+from cmd2 import style, fg, bg
class BasicApp(cmd2.Cmd):
@@ -19,7 +19,7 @@ class BasicApp(cmd2.Cmd):
super().__init__(multiline_commands=['echo'], persistent_history_file='cmd2_history.dat',
startup_script='scripts/startup.txt', use_ipython=True)
- self.intro = style('Welcome to PyOhio 2019 and cmd2!', fg='red', bg='white', bold=True) + ' 😀'
+ self.intro = style('Welcome to PyOhio 2019 and cmd2!', fg=fg.red, bg=bg.white, bold=True) + ' 😀'
# Allow access to your application in py and ipy via self
self.self_in_py = True