Switched unicode to be the default mode.
This commit is contained in:
@@ -73,9 +73,9 @@ Example config:
|
||||
# Default submission link - will be opened every time the program starts
|
||||
# link=http://www.reddit.com/r/CollegeBasketball/comments/31irjq
|
||||
|
||||
# Enable unicode characters (experimental)
|
||||
# This is known to be unstable with east asian wide character sets
|
||||
# unicode=true
|
||||
# Enable ascii-only mode and disable unicode characters
|
||||
# This may be necessary for compatability with some terminal browsers
|
||||
# ascii=True
|
||||
|
||||
RTV allows users to compose comments and replys using their preferred text editor (**vi**, **nano**, **gedit**, etc).
|
||||
Set the environment variable ``RTV_EDITOR`` to specify which editor the program should use.
|
||||
|
||||
@@ -44,8 +44,8 @@ def load_config():
|
||||
if config.has_section('rtv'):
|
||||
defaults = dict(config.items('rtv'))
|
||||
|
||||
if 'unicode' in defaults:
|
||||
defaults['unicode'] = config.getboolean('rtv', 'unicode')
|
||||
if 'ascii' in defaults:
|
||||
defaults['ascii'] = config.getboolean('rtv', 'ascii')
|
||||
|
||||
return defaults
|
||||
|
||||
@@ -59,8 +59,8 @@ def command_line():
|
||||
|
||||
parser.add_argument('-s', dest='subreddit', help='subreddit name')
|
||||
parser.add_argument('-l', dest='link', help='full link to a submission')
|
||||
parser.add_argument('--unicode', action='store_const', const=False,
|
||||
help='enable unicode (experimental)')
|
||||
parser.add_argument('--ascii', action='store_true',
|
||||
help='enable ascii-only mode')
|
||||
parser.add_argument('--log', metavar='FILE', action='store',
|
||||
help='Log HTTP requests')
|
||||
|
||||
@@ -95,7 +95,7 @@ def main():
|
||||
if getattr(args, key, None) is None:
|
||||
setattr(args, key, val)
|
||||
|
||||
config.unicode = False if args.unicode is None else args.unicode
|
||||
config.unicode = (not args.ascii)
|
||||
|
||||
# Squelch SSL warnings for Ubuntu
|
||||
logging.captureWarnings(True)
|
||||
|
||||
@@ -5,6 +5,7 @@ import curses
|
||||
from curses import textpad, ascii
|
||||
from contextlib import contextmanager
|
||||
|
||||
from . import config
|
||||
from .docs import HELP
|
||||
from .helpers import strip_textpad, clean
|
||||
from .exceptions import EscapeInterrupt
|
||||
@@ -20,10 +21,10 @@ ESCAPE = 27
|
||||
# found to be buggy and a PITA to work with. By defining them as unicode
|
||||
# points they can be added via the more reliable curses.addstr().
|
||||
# http://bugs.python.org/issue21088
|
||||
UARROW = u'\u25b2'
|
||||
DARROW = u'\u25bc'
|
||||
BULLET = u'\u2022'
|
||||
GOLD = u'\u272A'
|
||||
UARROW = u'\u25b2' if config.unicode else '^'
|
||||
DARROW = u'\u25bc' if config.unicode else 'v'
|
||||
BULLET = u'\u2022' if config.unicode else 'o'
|
||||
GOLD = u'\u272A' if config.unicode else '*'
|
||||
|
||||
def get_arrow(likes):
|
||||
"""
|
||||
|
||||
@@ -477,8 +477,7 @@ class BasePage(object):
|
||||
username = self.reddit.user.name
|
||||
s_col = (n_cols - textual_width(username) - 1)
|
||||
# Only print username if it fits in the empty space on the right
|
||||
if (s_col - 1) >= len(sub_name):
|
||||
n = (n_cols - s_col - 1)
|
||||
if (s_col - 1) >= textual_width(sub_name):
|
||||
add_line(self._header_window, username, 0, s_col)
|
||||
|
||||
self._header_window.refresh()
|
||||
|
||||
@@ -12,6 +12,7 @@ from .submission import SubmissionPage
|
||||
from .content import SubredditContent
|
||||
from .helpers import open_browser, open_editor
|
||||
from .docs import SUBMISSION_FILE
|
||||
from .history import load_history, save_history
|
||||
from .curses_helpers import (GOLD, Color, LoadScreen, add_line, get_arrow,
|
||||
show_notification, prompt_input)
|
||||
|
||||
@@ -21,7 +22,6 @@ _logger = logging.getLogger(__name__)
|
||||
|
||||
history = load_history()
|
||||
|
||||
|
||||
@atexit.register
|
||||
def save_links():
|
||||
global history
|
||||
|
||||
Reference in New Issue
Block a user