summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-06-16 12:13:07 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-06-16 12:13:07 -0400
commitcb23c60fafa525066a4aeed60283a8a794e48ae7 (patch)
tree17d6bbe756c0358df79f4e288ed2f6698cc6c8c8 /tests/conftest.py
parentb8fa8ce48acacab29d7df52101bff3bcc58ca24f (diff)
downloadcmd2-git-cb23c60fafa525066a4aeed60283a8a794e48ae7.tar.gz
Dramatically changed the approach to this PR
Changes include: - pager is no longer a settable parameter which can be changed by the end user at runtime - The cmd2.Cmd class now has two different attributes: - pager - contains command-line command to use to display wrapped text using a pager - By default set to PAGER environment variable if it exists - 'more' on Windows or 'less -RXF' on POSIX - pager_chop - contains command-line command to use to display chopped (truncated) text using a pager - Set to same thing as pager unless pager starts with 'less', in which case a ' -S' gets appended - The cmd2.Cmd.ppaged() method now has an additional optional argument "chop" which defaults to False - If chop is True, then self.pager_chop gets used as the pager - If chop is False, then slef.pager gets used as the pager I couldn't think of any single solution which would somehow magically make all stakeholders perfectly happy. Hopefully this is a reasonable enough compromise that everyone feels that they can get what they need without too much pain ;-)
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 0027ac7d..90d45bd9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -80,10 +80,8 @@ SHORTCUTS_TXT = """Shortcuts for other commands:
"""
expect_colors = True
-pager = 'less -SRXF'
if sys.platform.startswith('win'):
expect_colors = False
- pager = 'more '
# Output from the show command with default settings
SHOW_TXT = """colors: {}
continuation_prompt: >
@@ -92,11 +90,10 @@ echo: False
editor: vim
feedback_to_output: False
locals_in_py: False
-pager: {}
prompt: (Cmd)
quiet: False
timing: False
-""".format(expect_colors, pager)
+""".format(expect_colors)
if expect_colors:
color_str = 'True '
@@ -110,11 +107,10 @@ echo: False # Echo command issued into output
editor: vim # Program used by ``edit``
feedback_to_output: False # Include nonessentials in `|`, `>` results
locals_in_py: False # Allow access to your application in py via self
-pager: {} # Command used for displaying paged output
prompt: (Cmd) # The prompt issued to solicit input
quiet: False # Don't print nonessential feedback
timing: False # Report execution times
-""".format(color_str, pager)
+""".format(color_str)
class StdOut(object):