Add --no-flash option to rtv, fixes #478
This commit is contained in:
@@ -80,6 +80,9 @@ def build_parser():
|
||||
help='Open external links using programs defined in the mailcap config')
|
||||
parser.add_argument(
|
||||
'-V', '--version', action='version', version='rtv '+__version__)
|
||||
parser.add_argument(
|
||||
'--no-flash', dest='flash', action='store_const', const=False,
|
||||
help='Disable screen flashing')
|
||||
return parser
|
||||
|
||||
|
||||
@@ -264,7 +267,8 @@ class Config(object):
|
||||
'oauth_redirect_port': partial(config.getint, 'rtv'),
|
||||
'oauth_scope': lambda x: rtv[x].split(','),
|
||||
'max_comment_cols': partial(config.getint, 'rtv'),
|
||||
'hide_username': partial(config.getboolean, 'rtv')
|
||||
'hide_username': partial(config.getboolean, 'rtv'),
|
||||
'flash': partial(config.getboolean, 'rtv')
|
||||
}
|
||||
|
||||
for key, func in params.items():
|
||||
|
||||
@@ -16,6 +16,9 @@ ascii = False
|
||||
; Turn on monochrome mode to disable color.
|
||||
monochrome = False
|
||||
|
||||
; Flash when an invalid action is executed.
|
||||
flash = True
|
||||
|
||||
; Enable debugging by logging all HTTP requests and errors to the given file.
|
||||
;log = /tmp/rtv.log
|
||||
|
||||
|
||||
@@ -118,12 +118,14 @@ class Terminal(object):
|
||||
self._display = display
|
||||
return self._display
|
||||
|
||||
@staticmethod
|
||||
def flash():
|
||||
def flash(self):
|
||||
"""
|
||||
Flash the screen to indicate that an action was invalid.
|
||||
"""
|
||||
return curses.flash()
|
||||
if self.config['flash']:
|
||||
return curses.flash()
|
||||
else:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def curs_set(val):
|
||||
|
||||
Reference in New Issue
Block a user