From b6ff23acadcae81cd8c787da2a609a6807883137 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Fri, 18 Dec 2015 18:30:52 -0800 Subject: [PATCH] Documentation updates. --- README.rst | 38 +++++++++----------------------------- rtv/config.py | 4 ++-- rtv/docs.py | 1 + rtv/rtv.cfg | 5 ++++- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/README.rst b/README.rst index bd10b9d..85b582c 100644 --- a/README.rst +++ b/README.rst @@ -166,7 +166,7 @@ RTV uses OAuth to facilitate logging into your reddit user account [#]_. The log 1. You initiate a login by pressing the ``u`` key. 2. You're redirected to a webbrowser where reddit will ask you to login and authorize RTV. 3. RTV uses the generated token to login on your behalf. -4. The token is stored on your computer at ``~/.config/rtv/refresh-token`` for future sessions. You can disable this behavior by setting ``persistent=False`` in your RTV config. +4. The token is stored on your computer at ``{HOME}/.config/rtv/refresh-token`` for future sessions. You can disable this behavior by setting ``persistent=False`` in your RTV config. Note that RTV no longer allows you to input your username/password directly. This method of cookie based authentication has been deprecated by reddit and will not be supported in future releases [#]_. @@ -177,34 +177,14 @@ Note that RTV no longer allows you to input your username/password directly. Thi Config File ----------- -RTV will read a configuration placed at ``~/.config/rtv/rtv.cfg`` (or ``$XDG_CONFIG_HOME``). -Each line in the file will replace the corresponding default argument in the launch script. -This can be used to avoid having to re-enter login credentials every time the program is launched. +RTV loads its config from ``{HOME}/.config/rtv/rtv.cfg`` (or ``$XDG_CONFIG_HOME``). +You can auto-generate this file by running -Example initial config: +.. code-block:: bash -**rtv.cfg** - -.. code-block:: ini - - [rtv] - # Log file location - log=/tmp/rtv.log - - # Default subreddit - subreddit=CollegeBasketball - - # Default submission link - will be opened every time the program starts - # link=http://www.reddit.com/r/CollegeBasketball/comments/31irjq - - # Turn on ascii-only mode and disable all unicode characters - # This may be necessary for compatibility with some terminal browsers - # ascii=True - - # Enable persistent storage of your authentication token - # This allows you to remain logged in when you restart the program - persistent=True + $ rtv --copy-config +View the default `config `_. === FAQ @@ -238,19 +218,19 @@ How do I run the repository code directly? ========= Changelog ========= -Please see `CHANGELOG.rst `_. +Please see `CHANGELOG.rst `_. ============ Contributors ============ -Please see `CONTRIBUTORS.rst `_. +Please see `CONTRIBUTORS.rst `_. ======= License ======= -Please see `LICENSE `_. +Please see `LICENSE `_. .. |python| image:: https://img.shields.io/badge/python-2.7%2C%203.5-blue.svg diff --git a/rtv/config.py b/rtv/config.py index 29e105a..81cf04b 100644 --- a/rtv/config.py +++ b/rtv/config.py @@ -38,10 +38,10 @@ def build_parser(): help='full URL of a submission that will be opened on start') parser.add_argument( '--log', metavar='FILE', action='store', - help='log HTTP requests') + help='log HTTP requests to the given file') parser.add_argument( '--config', metavar='FILE', action='store', - help='Load configuration settings') + help='Load configuration settings from the given file') parser.add_argument( '--ascii', action='store_const', const=True, help='enable ascii-only mode') diff --git a/rtv/docs.py b/rtv/docs.py index a13bf31..eb7503f 100644 --- a/rtv/docs.py +++ b/rtv/docs.py @@ -26,6 +26,7 @@ Basic Commands `j/k` or `UP/DOWN` : Move the cursor up/down `m/n` or `PgUp/PgDn`: Jump to the previous/next page `o` or `ENTER` : Open the selected item as a webpage + `1`-`5` : Toggle post order `r` or `F5` : Refresh page content `u` : Log in or switch accounts `?` : Show the help screen diff --git a/rtv/rtv.cfg b/rtv/rtv.cfg index 35059b5..540ee7a 100644 --- a/rtv/rtv.cfg +++ b/rtv/rtv.cfg @@ -18,6 +18,9 @@ ascii = False ; Default subreddit that will be opened when the program launches. subreddit = front +;subreddit = python +;subreddit = python+linux+programming +;subreddit = all ; Allow rtv to store reddit authentication credentials between sessions. persistent = True @@ -32,7 +35,7 @@ history_size = 200 # OAuth Settings ################ ; This sections defines the paramaters that will be used during the OAuth -; authentication process. RTV is registered as an "installed app", +; authentication process. rtv is registered as an "installed app", ; see https://github.com/reddit/reddit/wiki/OAuth2 for more information. ; These settings are defined at https://www.reddit.com/prefs/apps and should