Updated the supported python versions list.
Fixed regression in displaying xposts. #173.
Fixing a few style things.
Added a more robust test for the tornado handler.
Trying without pytest-cov
Updated travis for coverage.
Remove python 3.2 support because no unicode literals, following what praw supports.
"Side effect is not iterable."
Added requirements for travis.
Renamed travis file correctly.
Adding test configurations, got tox working.
Adding vcr cassettes to the repo.
Renamed requirements files.
Split up tests and cleaned up test names.
Tests done, still one failure.
Treat cassettes as binary to prevent bad merging.
Fixed a few broken tests.
Added a timeout to notifications.
Prepping subreddit page.
Finished submission page tests.
Working on submission tests.
Fixed vcr matching on urls with params, started submission tests.
Log cleanup.
Still trying to fix a broken test.
-Fixed a few pytest bugs and tweaked logging.
Still working on subscription tests.
Finished page tests, on to subscription page.
Finished content tests and starting page tests.
Added the test refresh-token file to gitignore.
Moved functional test file out of the repository.
Continuing work on subreddit content tests.
Tests now match module names, cassettes are split into individual tests for faster loading.
Linter fixes.
Cleanup.
Added support for nested loaders.
Added pytest options, starting subreddit content tests.
Back on track with loader, continuing content tests.
Finishing submission content tests and discovered snag with loader exception handling.
VCR up and running, continuing to implement content tests.
Playing around with vcr.py
Moved helper functions into terminal and new objects.py
Fixed a few broken tests.
Working on navigator tests.
Reorganizing some things.
Mocked webbrowser._tryorder for terminal test.
Completed oauth tests.
Progress on the oauth tests.
Working on adding fake tornado request.
Starting on OAuth tool tests.
Finished curses helpers tests.
Still working on curses helpers tests.
Almost finished with tests on curses helpers.
Adding tests and working on mocking stdscr.
Starting to add tests for curses functions.
Merge branch 'future_work' of https://github.com/michael-lazar/rtv into future_work
Refactoring controller, still in progress.
Renamed auth handler.
Rename CursesHelper to CursesBase.
Added temporary file with a possible template for func testing.
Mixup between basename and dirname.
Merge branch 'future_work' of https://github.com/michael-lazar/rtv into future_work
py3 compatability for mock.
Beginning to refactor the curses session.
Started adding tests, improved unicode handling in the config.
Cleanup, fixed a few typos.
Major refactor, almost done!.
Started a config class.
Merge branch 'master' into future_work
The editor now handles unicode characters in all situations.
Fixed a few typos from previous commits.
__main__.py formatting.
Cleaned up history logic and moved to the config file.
70 lines
2.3 KiB
Python
70 lines
2.3 KiB
Python
"""
|
|
Internal tool used to automatically generate an up-to-date version of the rtv
|
|
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.
|
|
|
|
Usage:
|
|
$ python scripts/build_manpage.py
|
|
"""
|
|
import os
|
|
import sys
|
|
from datetime import datetime
|
|
|
|
_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
|
|
|
|
|
|
def main():
|
|
|
|
parser = config.build_parser()
|
|
help_text = parser.format_help()
|
|
help_sections = help_text.split('\n\n')
|
|
|
|
data = {}
|
|
print('Fetching version')
|
|
data['version'] = rtv.__version__
|
|
print('Fetching release date')
|
|
data['release_date'] = datetime.utcnow().strftime('%B %d, %Y')
|
|
print('Fetching synopsis')
|
|
synopsis = help_sections[0].replace('usage: ', '')
|
|
synopsis = ' '.join(line.strip() for line in synopsis.split('\n'))
|
|
data['synopsis'] = synopsis
|
|
print('Fetching description')
|
|
data['description'] = help_sections[1]
|
|
# Build the options section for each argument from the help section
|
|
# Example Before:
|
|
# -h, --help show this help message and exit
|
|
# Example After
|
|
# .TP
|
|
# \fB-h\fR, \fB--help\fR
|
|
# show this help message and exit
|
|
options = ''
|
|
arguments = help_sections[2].split('\n')
|
|
for argument in arguments[1:]:
|
|
argument = argument.strip()
|
|
flag, description = (col.strip() for col in argument.split(' ', 1))
|
|
flag = ', '.join(r'\fB'+f+r'\fR' for f in flag.split(', '))
|
|
options += '\n'.join(('.TP', flag, description, '\n'))
|
|
data['options'] = options
|
|
print('Fetching license')
|
|
data['license'] = rtv.__license__
|
|
print('Fetching copyright')
|
|
data['copyright'] = rtv.__copyright__
|
|
# Escape dashes is all of the sections
|
|
data = {k: v.replace('-', r'\-') for k, v in data.items()}
|
|
print('Reading from %s/rtv/templates/rtv.1.template' % ROOT)
|
|
with open(os.path.join(ROOT, 'rtv/templates/rtv.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:
|
|
fp.write(out)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|