Added docstrings for urlview.
This commit is contained in:
@@ -489,11 +489,16 @@ class Terminal(object):
|
|||||||
_logger.info('File deleted: %s', filepath)
|
_logger.info('File deleted: %s', filepath)
|
||||||
|
|
||||||
def open_urlview(self, data):
|
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'
|
urlview = os.getenv('RTV_URLVIEWER') or 'urlview'
|
||||||
try:
|
try:
|
||||||
with self.suspend():
|
with self.suspend():
|
||||||
p = subprocess.Popen([urlview],
|
p = subprocess.Popen([urlview], stdin=subprocess.PIPE)
|
||||||
stdin=subprocess.PIPE)
|
|
||||||
try:
|
try:
|
||||||
p.communicate(input=six.b(data))
|
p.communicate(input=six.b(data))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user