Merge branch 'master' into custom_commands2
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
RTV Changelog
|
RTV Changelog
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
.. _1.10.0: http://github.com/michael-lazar/rtv/releases/tag/v1.10.0
|
||||||
.. _1.9.1: http://github.com/michael-lazar/rtv/releases/tag/v1.9.1
|
.. _1.9.1: http://github.com/michael-lazar/rtv/releases/tag/v1.9.1
|
||||||
.. _1.9.0: http://github.com/michael-lazar/rtv/releases/tag/v1.9.0
|
.. _1.9.0: http://github.com/michael-lazar/rtv/releases/tag/v1.9.0
|
||||||
.. _1.8.1: http://github.com/michael-lazar/rtv/releases/tag/v1.8.1
|
.. _1.8.1: http://github.com/michael-lazar/rtv/releases/tag/v1.8.1
|
||||||
@@ -18,6 +19,22 @@ RTV Changelog
|
|||||||
.. _1.2.1: http://github.com/michael-lazar/rtv/releases/tag/v1.2.1
|
.. _1.2.1: http://github.com/michael-lazar/rtv/releases/tag/v1.2.1
|
||||||
.. _1.2: http://github.com/michael-lazar/rtv/releases/tag/v1.2
|
.. _1.2: http://github.com/michael-lazar/rtv/releases/tag/v1.2
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
1.10.0_ (2016-07-11)
|
||||||
|
--------------------
|
||||||
|
Features
|
||||||
|
|
||||||
|
* New command, `b` extracts urls from comments using urlviewer.
|
||||||
|
* Comment files will no longer be destroyed if RTV encounters an error while posting.
|
||||||
|
* The terminal title now displays the subreddit name/url.
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
|
||||||
|
* Fixed crash when entering empty or invalid subreddit name.
|
||||||
|
* Fixed crash when opening x-posts linked to subreddits.
|
||||||
|
* Fixed a bug where the terminal title wasn't getting set.
|
||||||
|
* **/r/me** is now displayed as *My Submissions* in the header.
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
1.9.1_ (2016-06-13)
|
1.9.1_ (2016-06-13)
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
6
rtv.1
6
rtv.1
@@ -1,4 +1,4 @@
|
|||||||
.TH "RTV" "1" "June 14, 2016" "Version 1.9.1" "Usage and Commands"
|
.TH "RTV" "1" "July 12, 2016" "Version 1.10.0" "Usage and Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
RTV - Reddit Terminal Viewer
|
RTV - Reddit Terminal Viewer
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -73,6 +73,10 @@ for future sessions. You can disable this behavior by setting the option
|
|||||||
Text editor to use when editing comments and submissions. Will fallback to
|
Text editor to use when editing comments and submissions. Will fallback to
|
||||||
\fI$EDITOR\fR.
|
\fI$EDITOR\fR.
|
||||||
.TP
|
.TP
|
||||||
|
.BR RTV_URLVIEWER
|
||||||
|
Url Viewer to use to extract links from comments. Requires a compatible
|
||||||
|
Url Viewer to be installed
|
||||||
|
.TP
|
||||||
.BR BROWSER
|
.BR BROWSER
|
||||||
Web browser to use when opening links.
|
Web browser to use when opening links.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import locale
|
import locale
|
||||||
import logging
|
import logging
|
||||||
@@ -29,16 +30,17 @@ _logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"Main entry point"
|
"""Main entry point"""
|
||||||
|
|
||||||
# Squelch SSL warnings
|
# Squelch SSL warnings
|
||||||
logging.captureWarnings(True)
|
logging.captureWarnings(True)
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
# Set the terminal title
|
# Set the terminal title
|
||||||
title = 'rtv {0}'.format(__version__)
|
if os.getenv('DISPLAY'):
|
||||||
sys.stdout.write('\x1b]2;{0}\x07'.format(title))
|
title = 'rtv {0}'.format(__version__)
|
||||||
sys.stdout.flush()
|
sys.stdout.write('\x1b]2;{0}\x07'.format(title))
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
args = Config.get_args()
|
args = Config.get_args()
|
||||||
fargs, bindings = Config.get_file(args.get('config'))
|
fargs, bindings = Config.get_file(args.get('config'))
|
||||||
@@ -79,6 +81,14 @@ def main():
|
|||||||
filename=config['log'],
|
filename=config['log'],
|
||||||
format='%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d:%(message)s')
|
format='%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d:%(message)s')
|
||||||
_logger.info('Starting new session, RTV v%s', __version__)
|
_logger.info('Starting new session, RTV v%s', __version__)
|
||||||
|
env = [
|
||||||
|
('$DISPLAY', os.getenv('DISPLAY')),
|
||||||
|
('$XDG_CONFIG_HOME', os.getenv('XDG_CONFIG_HOME')),
|
||||||
|
('$BROWSER', os.getenv('BROWSER')),
|
||||||
|
('$PAGER', os.getenv('PAGER')),
|
||||||
|
('$RTV_EDITOR', os.getenv('RTV_EDITOR')),
|
||||||
|
('$RTV_URLVIEWER', os.getenv('RTV_URLVIEWER'))]
|
||||||
|
_logger.info('Environment: %s', env)
|
||||||
else:
|
else:
|
||||||
# Add an empty handler so the logger doesn't complain
|
# Add an empty handler so the logger doesn't complain
|
||||||
logging.root.addHandler(logging.NullHandler())
|
logging.root.addHandler(logging.NullHandler())
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '1.9.1'
|
__version__ = '1.10.0'
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import curses
|
import curses
|
||||||
@@ -233,7 +234,6 @@ class Page(object):
|
|||||||
else:
|
else:
|
||||||
raise TemporaryFileError()
|
raise TemporaryFileError()
|
||||||
|
|
||||||
|
|
||||||
@PageController.register(Command('INBOX'))
|
@PageController.register(Command('INBOX'))
|
||||||
@logged_in
|
@logged_in
|
||||||
def get_inbox(self):
|
def get_inbox(self):
|
||||||
@@ -291,9 +291,10 @@ class Page(object):
|
|||||||
else:
|
else:
|
||||||
title = sub_name
|
title = sub_name
|
||||||
|
|
||||||
title += ' - rtv {0}'.format(__version__)
|
if os.getenv('DISPLAY'):
|
||||||
sys.stdout.write('\x1b]2;{0}\x07'.format(title))
|
title += ' - rtv {0}'.format(__version__)
|
||||||
sys.stdout.flush()
|
sys.stdout.write('\x1b]2;{0}\x07'.format(title))
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
if self.reddit.user is not None:
|
if self.reddit.user is not None:
|
||||||
# The starting position of the name depends on if we're converting
|
# The starting position of the name depends on if we're converting
|
||||||
|
|||||||
@@ -105,7 +105,14 @@ class Terminal(object):
|
|||||||
if self._display is None:
|
if self._display is None:
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
# OSX doesn't always set DISPLAY so we can't use this to check
|
# OSX doesn't always set DISPLAY so we can't use this to check
|
||||||
display = True
|
# Note: Disabling for now, with the hope that if this
|
||||||
|
# is a widespread issue then people will complain and we can
|
||||||
|
# come up with a better solution. Checking for $DISPLAY is
|
||||||
|
# used extensively in mailcap files, so it really *should* be
|
||||||
|
# set properly. I don't have a mac anymore so I can't test.
|
||||||
|
|
||||||
|
# display = True
|
||||||
|
display = bool(os.environ.get("DISPLAY"))
|
||||||
else:
|
else:
|
||||||
display = bool(os.environ.get("DISPLAY"))
|
display = bool(os.environ.get("DISPLAY"))
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def test_terminal_properties(terminal, config):
|
|||||||
with mock.patch('rtv.terminal.sys') as sys, \
|
with mock.patch('rtv.terminal.sys') as sys, \
|
||||||
mock.patch.dict('os.environ', {'DISPLAY': ''}):
|
mock.patch.dict('os.environ', {'DISPLAY': ''}):
|
||||||
sys.platform = 'darwin'
|
sys.platform = 'darwin'
|
||||||
assert terminal.display is True
|
assert terminal.display is False
|
||||||
|
|
||||||
terminal._display = None
|
terminal._display = None
|
||||||
with mock.patch.dict('os.environ', {'DISPLAY': ':0', 'BROWSER': 'w3m'}):
|
with mock.patch.dict('os.environ', {'DISPLAY': ':0', 'BROWSER': 'w3m'}):
|
||||||
|
|||||||
Reference in New Issue
Block a user