Rename rtv to tuir

This commit is contained in:
John Helmert
2019-06-09 19:31:35 -05:00
parent 481780fffa
commit 7e9455b4ca
76 changed files with 352 additions and 359 deletions

View File

@@ -2,7 +2,7 @@ Release Checklist
-----------------
1. Switch to the master branch and stash any uncommited changes.
2. Bump the version number in [rtv/\_\_version\_\_.py](rtv/__version__.py).
2. Bump the version number in [tuir/\_\_version\_\_.py](tuir/__version__.py).
3. Update the release notes in the [CHANGELOG.rst](CHANGELOG.rst).
4. Update the contributor list by running [``scripts/build_authors.py``](scripts/build_authors.py).
5. Re-generate the manpage by running [``scripts/build_manpage.py``](scripts/build_manpage.py).
@@ -11,7 +11,7 @@ Release Checklist
8. Clean out any old build/release files by running [``scripts/pip_clean.py``](scripts/pip_clean.py).
9. Build the source tarball and binary wheel: ``$ python3 setup.py sdist bdist_wheel``
10. Upload the packages to PyPI: ``$ twine upload dist/*``
11. Verify that the upload was successful: ``$ pip install rtv --upgrade --force-reinstall``
11. Verify that the upload was successful: ``$ pip install tuir --upgrade --force-reinstall``
12. Smoke test the new release on Python 2 and Python 3.
12. Create a new release on Github and copy the release notes from the changelog.
13. Use Github to delete any old branches that have been merged.

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Internal tool used to automatically generate an up-to-date version of the rtv
Internal tool used to automatically generate an up-to-date version of the tuir
man page. Currently this script should be manually ran after each version bump.
In the future, it would be nice to have this functionality built into setup.py.
@@ -17,8 +17,8 @@ _filepath = os.path.dirname(os.path.relpath(__file__))
ROOT = os.path.abspath(os.path.join(_filepath, '..'))
sys.path.insert(0, ROOT)
import rtv
from rtv import config
import tuir
from tuir import config
def main():
@@ -30,7 +30,7 @@ def main():
data = {}
print('Fetching version')
data['version'] = rtv.__version__
data['version'] = tuir.__version__
print('Fetching release date')
data['release_date'] = datetime.utcnow().strftime('%B %d, %Y')
print('Fetching synopsis')
@@ -65,18 +65,18 @@ def main():
options += '\n'.join(('.TP', flag, description, '\n'))
data['options'] = options
print('Fetching license')
data['license'] = rtv.__license__
data['license'] = tuir.__license__
print('Fetching copyright')
data['copyright'] = rtv.__copyright__
data['copyright'] = tuir.__copyright__
# Escape dashes is all of the sections
data = {k: v.replace('-', r'\-') for k, v in data.items()}
print('Reading from %s/scripts/rtv.1.template' % ROOT)
with open(os.path.join(ROOT, 'scripts/rtv.1.template')) as fp:
print('Reading from %s/scripts/tuir.1.template' % ROOT)
with open(os.path.join(ROOT, 'scripts/tuir.1.template')) as fp:
template = fp.read()
print('Populating template')
out = template.format(**data)
print('Writing to %s/rtv.1' % ROOT)
with open(os.path.join(ROOT, 'rtv.1'), 'w') as fp:
print('Writing to %s/tuir.1' % ROOT)
with open(os.path.join(ROOT, 'tuir.1'), 'w') as fp:
fp.write(out)

View File

@@ -8,8 +8,8 @@ echo "$(wc -l tests/*.py)"
echo -e "\nScripts: "
echo "$(wc -l scripts/*)"
echo -e "\nTemplates: "
echo "$(wc -l rtv/templates/*)"
echo "$(wc -l tuir/templates/*)"
echo -e "\nCode: "
echo "$(wc -l rtv/*.py)"
echo "$(wc -l tuir/*.py)"
echo -e "\nCombined: "
echo "$(cat tests/*.py scripts/* rtv/templates/* rtv/*.py | wc -l) total lines"
echo "$(cat tests/*.py scripts/* tuir/templates/* tuir/*.py | wc -l) total lines"

View File

@@ -15,15 +15,15 @@ from collections import Counter
from vcr import VCR
from six.moves.urllib.parse import urlparse, parse_qs
from rtv.theme import Theme, ThemeList
from rtv.config import Config
from rtv.packages import praw
from rtv.oauth import OAuthHelper
from rtv.terminal import Terminal
from rtv.objects import curses_session
from rtv.subreddit_page import SubredditPage
from rtv.submission_page import SubmissionPage
from rtv.subscription_page import SubscriptionPage
from tuir.theme import Theme, ThemeList
from tuir.config import Config
from tuir.packages import praw
from tuir.oauth import OAuthHelper
from tuir.terminal import Terminal
from tuir.objects import curses_session
from tuir.subreddit_page import SubredditPage
from tuir.submission_page import SubmissionPage
from tuir.subscription_page import SubscriptionPage
try:
from unittest import mock

View File

@@ -3,10 +3,10 @@ Initialize an authenticated instance of PRAW to interact with.
$ python -i initialize_session.py
"""
from rtv.docs import AGENT
from rtv.packages import praw
from rtv.content import RequestHeaderRateLimiter
from rtv.config import Config
from tuir.docs import AGENT
from tuir.packages import praw
from tuir.content import RequestHeaderRateLimiter
from tuir.config import Config
config = Config()
config.load_refresh_token()
@@ -27,4 +27,4 @@ reddit.refresh_access_information(config.refresh_token)
inbox = reddit.get_inbox()
items = [next(inbox) for _ in range(20)]
pass
pass

View File

@@ -11,11 +11,11 @@ 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
TUIR_BROWSER, BROWSER = os.environ.get('TUIR_BROWSER'), os.environ.get('BROWSER')
if TUIR_BROWSER:
os.environ['BROWSER'] = TUIR_BROWSER
print('RTV_BROWSER=%s' % RTV_BROWSER)
print('TUIR_BROWSER=%s' % TUIR_BROWSER)
print('BROWSER=%s' % BROWSER)
import webbrowser

View File

@@ -1,6 +1,6 @@
.TH "RTV" "1" "{release_date}" "Version {version}" "Usage and Commands"
.TH "TUIR" "1" "{release_date}" "Version {version}" "Usage and Commands"
.SH NAME
RTV - Reddit Terminal Viewer
TUIR - Terminal UI for Reddit
.SH SYNOPSIS
{synopsis}
.SH DESCRIPTION
@@ -17,32 +17,32 @@ 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
.BR $XDG_CONFIG_HOME/tuir/tuir.cfg
The configuration file can be used to customize default program settings.
.TP
.BR $XDG_DATA_HOME/rtv/refresh-token
.BR $XDG_DATA_HOME/tuir/refresh-token
After you login to reddit, your most recent OAuth refresh token will be stored
for future sessions.
.TP
.BR $XDG_DATA_HOME/rtv/history.log
.BR $XDG_DATA_HOME/tuir/history.log
This file stores URLs that have been recently opened in order to
visually highlight them as "seen".
.SH ENVIRONMENT
.TP
.BR RTV_EDITOR
.BR TUIR_EDITOR
Text editor to use when editing comments and submissions. Will fallback to
\fI$EDITOR\fR.
.TP
.BR RTV_URLVIEWER
.BR TUIR_URLVIEWER
Url viewer to use to extract links from comments. Requires a compatible
program to be installed.
.TP
.BR RTV_BROWSER
.BR TUIR_BROWSER
Web browser to use when opening links. Will fallback to \fI$BROWSER\fR.
.SH AUTHOR
Michael Lazar <lazar.michael22@gmail.com> (2017).
John Helmert <jchelmertt3@gmail.com> (2019).
John Helmert III <jchelmertt3@gmail.com> (2019).
.SH BUGS
Report bugs to \fIhttps://gitlab.com/ajak/rtv/issues\fR
Report bugs to \fIhttps://gitlab.com/ajak/tuir/issues\fR
.SH LICENSE
{license}

View File

@@ -29,13 +29,13 @@ def main():
commit = p.stdout.read().strip()
print('Found commit %s' % commit)
regex = 's/^__praw_hash__ =.*$/__praw_hash__ = \'%s\'/g' % commit
packages_root = os.path.join(ROOT, 'rtv', 'packages', '__init__.py')
packages_root = os.path.join(ROOT, 'tuir', 'packages', '__init__.py')
print('Updating commit hash in %s' % packages_root)
subprocess.check_call(['sed', '-i', '', regex, packages_root])
# Overwrite the project files
src = os.path.join(tmpdir, 'praw')
dest = os.path.join(ROOT, 'rtv', 'packages', 'praw')
dest = os.path.join(ROOT, 'tuir', 'packages', 'praw')
print('Copying package files to %s' % dest)
shutil.rmtree(dest, ignore_errors=True)
shutil.copytree(src, dest)