diff --git a/README.rst b/README.rst index e42e829..5468883 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,7 @@ The ``/`` prompt accepts subreddits in the following formats * ``/r/python`` * ``/r/python/new`` +* ``/r/python+linux`` supports multireddits * ``/r/front`` will redirect to the front page **Submission Mode** diff --git a/rtv/__main__.py b/rtv/__main__.py new file mode 100644 index 0000000..846ccc1 --- /dev/null +++ b/rtv/__main__.py @@ -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() diff --git a/rtv/main.py b/rtv/main.py index 1be9b37..5b4a875 100644 --- a/rtv/main.py +++ b/rtv/main.py @@ -9,13 +9,12 @@ from rtv.utils import curses_session, load_config, HELP from rtv.subreddit import SubredditPage from rtv.submission import SubmissionPage -description = """ +DESCRIPTION = """ Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a terminal window. """ -# TODO: Figure out a way to sync this with the README -epilog = """ +EPILOG = """ Controls ----- 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. """ -epilog += HELP +EPILOG += HELP def main(): parser = argparse.ArgumentParser( - prog='rtv', description=description, epilog=epilog, + prog='rtv', description=DESCRIPTION, epilog=EPILOG, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('-s', dest='subreddit', help='subreddit name') parser.add_argument('-l', dest='link', help='full link to a submission') @@ -92,7 +91,3 @@ def main(): except SubredditNameError as e: print('Could not reach subreddit: {}'.format(e.name)) - - -if __name__ == '__main__': - main()