Fixed a few imports and docs.
This commit is contained in:
@@ -45,8 +45,8 @@ def command_line():
|
|||||||
parser.add_argument('-l', dest='link', help='full link to a submission')
|
parser.add_argument('-l', dest='link', help='full link to a submission')
|
||||||
parser.add_argument('--unicode', action='store_true',
|
parser.add_argument('--unicode', action='store_true',
|
||||||
help='enable unicode (experimental)')
|
help='enable unicode (experimental)')
|
||||||
parser.add_argument('--log', action='store',
|
parser.add_argument('--log', metavar='FILE', action='store',
|
||||||
help='Log all HTTP requests to the given file')
|
help='Log HTTP requests')
|
||||||
|
|
||||||
group = parser.add_argument_group('authentication (optional)', AUTH)
|
group = parser.add_argument_group('authentication (optional)', AUTH)
|
||||||
group.add_argument('-u', dest='username', help='reddit username')
|
group.add_argument('-u', dest='username', help='reddit username')
|
||||||
@@ -102,4 +102,4 @@ def main():
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
return
|
return
|
||||||
|
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import time
|
|||||||
import threading
|
import threading
|
||||||
import curses
|
import curses
|
||||||
from curses import textpad, ascii
|
from curses import textpad, ascii
|
||||||
|
from contextlib import contextmanager
|
||||||
|
|
||||||
from .docs import HELP
|
from .docs import HELP
|
||||||
from .helpers import strip_textpad
|
from .helpers import strip_textpad
|
||||||
@@ -272,4 +273,4 @@ def curses_session():
|
|||||||
stdscr.keypad(0)
|
stdscr.keypad(0)
|
||||||
curses.echo()
|
curses.echo()
|
||||||
curses.nocbreak()
|
curses.nocbreak()
|
||||||
curses.endwin()
|
curses.endwin()
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a
|
|||||||
terminal window.
|
terminal window.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
AUTH = """
|
AUTH = """\
|
||||||
Authenticating is required to vote and leave comments. For added security, it
|
Authenticating is required to vote and leave comments. If only a username is
|
||||||
is recommended that only you only provide a username. There will be an
|
given, the program will display a secure prompt to enter a password.
|
||||||
additional prompt for the password if it is not provided.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
CONTROLS = """
|
CONTROLS = """
|
||||||
@@ -43,4 +42,4 @@ Subreddit Mode
|
|||||||
Submission Mode
|
Submission Mode
|
||||||
`LEFT` or `h` : Return to subreddit mode
|
`LEFT` or `h` : Return to subreddit mode
|
||||||
`RIGHT` or `l` : Fold the selected comment, or load additional comments
|
`RIGHT` or `l` : Fold the selected comment, or load additional comments
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import praw.errors
|
|||||||
|
|
||||||
from .content import SubmissionContent
|
from .content import SubmissionContent
|
||||||
from .page import BasePage
|
from .page import BasePage
|
||||||
from .workers import LoadScreen, open_browser
|
from .helpers import clean, open_browser
|
||||||
from .curses_helpers import (BULLET, UARROW, DARROW, Color, show_help,
|
from .curses_helpers import (BULLET, UARROW, DARROW, Color, LoadScreen,
|
||||||
text_input)
|
show_help, text_input)
|
||||||
|
|
||||||
__all__ = ['SubmissionPage']
|
__all__ = ['SubmissionPage']
|
||||||
|
|
||||||
@@ -280,4 +280,4 @@ class SubmissionPage(BasePage):
|
|||||||
display_message(self.stdscr, [e.message])
|
display_message(self.stdscr, [e.message])
|
||||||
else:
|
else:
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
self.refresh_content()
|
self.refresh_content()
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ from .exceptions import SubredditError
|
|||||||
from .page import BasePage
|
from .page import BasePage
|
||||||
from .submission import SubmissionPage
|
from .submission import SubmissionPage
|
||||||
from .content import SubredditContent
|
from .content import SubredditContent
|
||||||
from .workers import LoadScreen, open_browser
|
from .helpers import clean, open_browser
|
||||||
from .curses_helpers import (BULLET, UARROW, DARROW, Color, text_input,
|
from .curses_helpers import (BULLET, UARROW, DARROW, Color, LoadScreen,
|
||||||
show_notification, show_help)
|
text_input, show_notification, show_help)
|
||||||
|
|
||||||
__all__ = ['opened_links', 'SubredditPage']
|
__all__ = ['opened_links', 'SubredditPage']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user