Merge remote-tracking branch 'origin/master' into custom_commands2
This commit is contained in:
@@ -5,7 +5,9 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import locale
|
import locale
|
||||||
import logging
|
import logging
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
import six
|
||||||
import praw
|
import praw
|
||||||
import tornado
|
import tornado
|
||||||
|
|
||||||
@@ -34,6 +36,10 @@ def main():
|
|||||||
|
|
||||||
# Squelch SSL warnings
|
# Squelch SSL warnings
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
|
if six.PY3:
|
||||||
|
# These ones get triggered even when capturing warnings is turned on
|
||||||
|
warnings.simplefilter('ignore', ResourceWarning)
|
||||||
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
# Set the terminal title
|
# Set the terminal title
|
||||||
|
|||||||
@@ -585,6 +585,16 @@ class Terminal(object):
|
|||||||
p.communicate(input=data.encode('utf-8'))
|
p.communicate(input=data.encode('utf-8'))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
p.terminate()
|
p.terminate()
|
||||||
|
|
||||||
|
code = p.poll()
|
||||||
|
if code == 1:
|
||||||
|
# Clear the "No URLs found." message from stdout
|
||||||
|
sys.stdout.write("\033[F")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
if code == 1:
|
||||||
|
self.show_notification('No URLs found')
|
||||||
|
|
||||||
except OSError:
|
except OSError:
|
||||||
self.show_notification(
|
self.show_notification(
|
||||||
'Failed to open {0}'.format(urlview))
|
'Failed to open {0}'.format(urlview))
|
||||||
|
|||||||
Reference in New Issue
Block a user