From cfb0583541da64e5eb9bb9d71c8d11a1a80dfdbe Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Mon, 11 Jul 2016 18:11:53 -0700 Subject: [PATCH] Added docstrings for urlview. --- rtv/terminal.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rtv/terminal.py b/rtv/terminal.py index ebd048a..115532d 100644 --- a/rtv/terminal.py +++ b/rtv/terminal.py @@ -489,11 +489,16 @@ class Terminal(object): _logger.info('File deleted: %s', filepath) def open_urlview(self, data): + """ + Pipe a block of text to urlview, which displays a list of urls + contained in the text and allows the user to open them with their + web browser. + """ + urlview = os.getenv('RTV_URLVIEWER') or 'urlview' try: with self.suspend(): - p = subprocess.Popen([urlview], - stdin=subprocess.PIPE) + p = subprocess.Popen([urlview], stdin=subprocess.PIPE) try: p.communicate(input=six.b(data)) except KeyboardInterrupt: