Merge branch 'master' into themes

This commit is contained in:
Michael Lazar
2017-09-07 22:31:43 -04:00
65 changed files with 20824 additions and 2168 deletions

View File

@@ -46,12 +46,16 @@ def main():
# \fB-h\fR, \fB--help\fR
# show this help message and exit
options = ''
lines = help_sections[2].split('\n')[1:]
lines = help_sections[2].split('\n')[1:] # positional arguments
lines.extend(help_sections[3].split('\n')[1:]) # optional arguments
lines = [line.strip() for line in lines]
arguments = []
for line in lines:
if line.startswith('-'):
arguments.append(line)
elif line.startswith('URL'):
# Special case for URL which is a positional argument
arguments.append(line)
else:
arguments[-1] = arguments[-1] + ' ' + line
for argument in arguments:

15
scripts/count_lines.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
ROOT="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")"
cd ${ROOT}
echo -e "\nTests: "
echo "$(wc -l tests/*.py)"
echo -e "\nScripts: "
echo "$(wc -l scripts/*)"
echo -e "\nTemplates: "
echo "$(wc -l rtv/templates/*)"
echo -e "\nCode: "
echo "$(wc -l rtv/*.py)"
echo -e "\nCombined: "
echo "$(cat tests/*.py scripts/* rtv/templates/* rtv/*.py | wc -l) total lines"

31
scripts/inspect_webbrowser.py Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python
"""
Utility script used to examine the python webbrowser module with different OSs.
"""
import os
os.environ['BROWSER'] = 'firefox'
# If we want to override the $BROWSER variable that the python webbrowser
# references, it needs to be done before the webbrowser module is imported
# for the first time.
RTV_BROWSER, BROWSER = os.environ.get('RTV_BROWSER'), os.environ.get('BROWSER')
if RTV_BROWSER:
os.environ['BROWSER'] = RTV_BROWSER
print('RTV_BROWSER=%s' % RTV_BROWSER)
print('BROWSER=%s' % BROWSER)
import webbrowser
print('webbrowser._browsers:')
for key, val in webbrowser._browsers.items():
print(' %s: %s' % (key, val))
print('webbrowser._tryorder:')
for name in webbrowser._tryorder:
print(' %s' % name)
webbrowser.open_new_tab('https://www.python.org')

9
scripts/pip_clean.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Removes any lingering build/release files from the project directory
find . -type f -name '*.pyc' -delete
find . -type f -name '*.pyo' -delete
find . -type d -name '__pycache__' -exec rm -rv {} +
find . -type d -name 'build' -exec rm -rv {} +
find . -type d -name 'dist' -exec rm -rv {} +
find . -type d -name '*.egg-info' -exec rm -rv {} +

View File

@@ -8,15 +8,15 @@ RTV - Reddit Terminal Viewer
.SH OPTIONS
{options}
.SH CONTROLS
Move the cursor using either the arrow keys or Vim-style movement.
- Press \fBup\fR and \fBdown\fR to scroll through submissions.
- Press \fBright\fR to view the selected submission and \fBleft\fR to return.
- Press \fB?\fR to open the help screen.
Move the cursor using the arrow keys or vim style movement.
Press \fBup\fR and \fBdown\fR to scroll through submissions.
Press \fBright\fR to view the selected submission and \fBleft\fR to return.
Press \fB?\fR to open the help screen.
.SH FILES
.TP
.BR $XDG_CONFIG_HOME/rtv/rtv.cfg
The configuration file can be used to customize default program settings, see
README.rst for more information.
README.md for more information.
.TP
.BR $XDG_CONFIG_HOME/rtv/refresh-token
After you login to reddit, your most recent OAuth refresh token will be stored
@@ -29,16 +29,13 @@ Text editor to use when editing comments and submissions. Will fallback to
\fI$EDITOR\fR.
.TP
.BR RTV_URLVIEWER
Url Viewer to use to extract links from comments. Requires a compatible
Url Viewer to be installed
Url viewer to use to extract links from comments. Requires a compatible
program to be installed.
.TP
.BR BROWSER
Web browser to use when opening links.
.TP
.BR PAGER
Pager to use when expanding individual comments and submissions.
.BR RTV_BROWSER
Web browser to use when opening links. Will fallback to \fI$BROWSER\fR.
.SH AUTHOR
Michael Lazar <lazar.michael22@gmail.com> (2016).
Michael Lazar <lazar.michael22@gmail.com> (2017).
.SH BUGS
Report bugs to \fIhttps://github.com/michael-lazar/rtv/issues\fR
.SH LICENSE