def show(entry_id, colors=True, raw=False, html=False):
"""
Main function for showing an entry.
"""
conf.load()
try:
request = api.api_get_entry(entry_id)
__handle_request_error(request)
entr = entry.Entry(json.loads(request.response))
except api.OAuthException as ex:
print("Error: {0}".format(ex.text))
print()
exit(-1)
title = entr.title
try:
delimiter = "".ljust(os.get_terminal_size().columns, '=')
# piped output to file or other process
except OSError:
delimiter = "\n"
article = entr.content
if not html:
article = html2text(article, colors)
output = "{0}\n{1}\n{2}".format(title, delimiter, article)
if not raw:
output = __format_text(output)
print(output)
评论列表
文章目录