Added docstrings for urlview.

This commit is contained in:
Michael Lazar
2016-07-11 18:11:53 -07:00
parent a51e453660
commit cfb0583541

View File

@@ -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: