From 261daedad6ea7cf824584803f49ae1896b7623b8 Mon Sep 17 00:00:00 2001 From: ZhehaoMi <1125263974@qq.com> Date: Fri, 19 Oct 2018 12:10:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BD=93=E5=89=A9=E4=BD=99=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E5=B0=8F=E4=BA=8E1=E6=97=B6=E5=80=99=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7f7fd97..93a1ffe 100644 --- a/main.py +++ b/main.py @@ -70,10 +70,13 @@ def get_broadcast_content(broadcast_list: list): continue text = "" if delta.days > 0: - text = "距离 %s 还有 %d 天 (%d个月%s)." % ( - name, delta.days, mouths, ("%d天" % days) if days != 0 else "整") + if mounths > 0: + text = "距离 %s 还有 %d 天 (%d个月%s)." % ( + name, delta.days, mouths, ("%d天" % days) if days != 0 else "整") + else: + text = "距离 %s 还有 %d 天." % (name, delta.days) else: - text = "今天是 %s " % (name) + text = "今天是 %s ." % (name) print_log(text) result.append(text) return result -- Gitee From e90d4ec180f4ee1ffd425e1f4c482632e60b147a Mon Sep 17 00:00:00 2001 From: ZhehaoMi <1125263974@qq.com> Date: Fri, 19 Oct 2018 12:14:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BD=93=E5=89=A9=E4=BD=99=E6=9C=88?= =?UTF-8?q?=E4=BB=BD=E5=B0=8F=E4=BA=8E1=E6=97=B6=E5=80=99=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 93a1ffe..7cd2a15 100644 --- a/main.py +++ b/main.py @@ -70,7 +70,7 @@ def get_broadcast_content(broadcast_list: list): continue text = "" if delta.days > 0: - if mounths > 0: + if mouths > 0: text = "距离 %s 还有 %d 天 (%d个月%s)." % ( name, delta.days, mouths, ("%d天" % days) if days != 0 else "整") else: -- Gitee