From 57d3983bb496397388c2646f4fc7a9ce810d37b3 Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Sun, 15 Sep 2019 00:26:16 -0400 Subject: [PATCH] add dealer name to title in brackets (#22) --- rfd/__version__.py | 2 +- rfd/api.py | 1 + rfd/rfd_cli.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rfd/__version__.py b/rfd/__version__.py index 92b8ecb..868cfd5 100644 --- a/rfd/__version__.py +++ b/rfd/__version__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -version = '0.1.9' +version = '0.2.0' diff --git a/rfd/api.py b/rfd/api.py index bb3d148..5669d06 100644 --- a/rfd/api.py +++ b/rfd/api.py @@ -117,6 +117,7 @@ def parse_threads(api_response, limit): threads.append( { "title": topic.get("title"), + "dealer_name": topic["offer"].get("dealer_name"), "score": calculate_score(topic), "url": build_web_path(topic.get("web_path")), } diff --git a/rfd/rfd_cli.py b/rfd/rfd_cli.py index 183804e..27cabf5 100644 --- a/rfd/rfd_cli.py +++ b/rfd/rfd_cli.py @@ -133,7 +133,7 @@ def threads(limit, forum_id): + "." + get_vote_color(thread.get("score")) + Fore.RESET - + thread.get("title") + + "[%s] %s" % (thread.get("dealer_name"), thread.get("title")) ) click.echo(Fore.BLUE + " {}".format(thread.get("url"))) click.echo(Style.RESET_ALL)