Add config option to hide username if logged in
This commit is contained in:
@@ -241,7 +241,8 @@ class Config(object):
|
|||||||
'history_size': partial(config.getint, 'rtv'),
|
'history_size': partial(config.getint, 'rtv'),
|
||||||
'oauth_redirect_port': partial(config.getint, 'rtv'),
|
'oauth_redirect_port': partial(config.getint, 'rtv'),
|
||||||
'oauth_scope': lambda x: rtv[x].split(','),
|
'oauth_scope': lambda x: rtv[x].split(','),
|
||||||
'max_comment_cols': partial(config.getint, 'rtv')
|
'max_comment_cols': partial(config.getint, 'rtv'),
|
||||||
|
'hide_username': partial(config.getboolean, 'rtv')
|
||||||
}
|
}
|
||||||
|
|
||||||
for key, func in params.items():
|
for key, func in params.items():
|
||||||
|
|||||||
@@ -349,6 +349,9 @@ class Page(object):
|
|||||||
# to ascii or not
|
# to ascii or not
|
||||||
width = len if self.config['ascii'] else textual_width
|
width = len if self.config['ascii'] else textual_width
|
||||||
|
|
||||||
|
if self.config['hide_username']:
|
||||||
|
username = "Logged in"
|
||||||
|
else:
|
||||||
username = self.reddit.user.name
|
username = self.reddit.user.name
|
||||||
s_col = (n_cols - width(username) - 1)
|
s_col = (n_cols - width(username) - 1)
|
||||||
# Only print username if it fits in the empty space on the right
|
# Only print username if it fits in the empty space on the right
|
||||||
|
|||||||
Reference in New Issue
Block a user