Added multireddits to readme.
This commit is contained in:
@@ -61,6 +61,7 @@ The ``/`` prompt accepts subreddits in the following formats
|
|||||||
|
|
||||||
* ``/r/python``
|
* ``/r/python``
|
||||||
* ``/r/python/new``
|
* ``/r/python/new``
|
||||||
|
* ``/r/python+linux`` supports multireddits
|
||||||
* ``/r/front`` will redirect to the front page
|
* ``/r/front`` will redirect to the front page
|
||||||
|
|
||||||
**Submission Mode**
|
**Submission Mode**
|
||||||
|
|||||||
7
rtv/__main__.py
Normal file
7
rtv/__main__.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Entry point for rtv module
|
||||||
|
# Run by moving into the top level directory (the one with setup.py)
|
||||||
|
# and typing "python -m rtv"
|
||||||
|
|
||||||
|
from rtv.main import main
|
||||||
|
|
||||||
|
main()
|
||||||
13
rtv/main.py
13
rtv/main.py
@@ -9,13 +9,12 @@ from rtv.utils import curses_session, load_config, HELP
|
|||||||
from rtv.subreddit import SubredditPage
|
from rtv.subreddit import SubredditPage
|
||||||
from rtv.submission import SubmissionPage
|
from rtv.submission import SubmissionPage
|
||||||
|
|
||||||
description = """
|
DESCRIPTION = """
|
||||||
Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a
|
Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a
|
||||||
terminal window.
|
terminal window.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: Figure out a way to sync this with the README
|
EPILOG = """
|
||||||
epilog = """
|
|
||||||
Controls
|
Controls
|
||||||
-----
|
-----
|
||||||
RTV currently supports browsing both subreddits and individual submissions.
|
RTV currently supports browsing both subreddits and individual submissions.
|
||||||
@@ -25,12 +24,12 @@ subreddit. In submission mode you can view the self text for a submission and
|
|||||||
browse comments.
|
browse comments.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
epilog += HELP
|
EPILOG += HELP
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
prog='rtv', description=description, epilog=epilog,
|
prog='rtv', description=DESCRIPTION, epilog=EPILOG,
|
||||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||||
parser.add_argument('-s', dest='subreddit', help='subreddit name')
|
parser.add_argument('-s', dest='subreddit', help='subreddit name')
|
||||||
parser.add_argument('-l', dest='link', help='full link to a submission')
|
parser.add_argument('-l', dest='link', help='full link to a submission')
|
||||||
@@ -92,7 +91,3 @@ def main():
|
|||||||
|
|
||||||
except SubredditNameError as e:
|
except SubredditNameError as e:
|
||||||
print('Could not reach subreddit: {}'.format(e.name))
|
print('Could not reach subreddit: {}'.format(e.name))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user