Skip to content

Commit 9a32f4f

Browse files
committed
Aborted attempt at using pydoc's pager
1 parent cb5d78c commit 9a32f4f

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

trepan/inout/output.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def __init__(self, out=None, opts=None):
3030
self.flush_after_write = False
3131
self.output = out or sys.stdout
3232
self.open(self.output, opts)
33+
if hasattr(self.output, "isatty"):
34+
self.isatty = self.output.isatty
3335
return
3436

3537
def flush(self):

trepan/interfaces/user.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
# Copyright (C) 2009-2010, 2013-2015,
3-
# 2017-2018 Rocky Bernstein <rocky@gnu.org>
3+
# 2017-2018, 2020 Rocky Bernstein <rocky@gnu.org>
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -89,7 +89,7 @@ def close(self):
8989
return
9090

9191
def confirm(self, prompt, default):
92-
""" Called when a dangerous action is about to be done, to make
92+
"""Called when a dangerous action is about to be done, to make
9393
sure it's okay. Expect a yes/no answer to `prompt' which is printed,
9494
suffixed with a question mark and the default value. The user
9595
response converted to a boolean is returned."""
@@ -114,9 +114,20 @@ def confirm(self, prompt, default):
114114
pass
115115
return default
116116

117-
def errmsg(self, msg, prefix="** "):
118-
"""Common routine for reporting debugger error messages.
117+
def msg(self, msg):
118+
"""used to write to a debugger that is connected to this
119+
server; `str' written will have a newline added to it
119120
"""
121+
super().msg(msg)
122+
# from pydoc import ttypager
123+
# if hasattr(self.output, "isatty"):
124+
# ttypager(msg)
125+
# super().msg("")
126+
# else:
127+
# super().msg(msg)
128+
129+
def errmsg(self, msg, prefix="** "):
130+
"""Common routine for reporting debugger error messages."""
120131
return self.msg("%s%s" % (prefix, msg))
121132

122133
def finalize(self, last_wishes=None):

0 commit comments

Comments
 (0)