From f5f0a0644f77f62a64c96d522c5eb40b527a602b Mon Sep 17 00:00:00 2001 From: Michael Woolweaver Date: Mon, 15 Apr 2019 23:10:28 -0500 Subject: [PATCH] translate to english again and maybe commas are ok --- pihole_tweeter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pihole_tweeter.py b/pihole_tweeter.py index 6d235cf..c775658 100644 --- a/pihole_tweeter.py +++ b/pihole_tweeter.py @@ -31,7 +31,7 @@ if not (api_path, consumer_key, consumer_key, consumer_secret, access_token, acc def comma_value(num): """Helper function for thousand separators""" - return "{:,}".format(int(num)).replace(',', '.') + return "{:,}".format(int(num)).replace(',', ',') def get_api(): @@ -66,11 +66,11 @@ def get_pihole_data(): def construct_tweet(data): today = datetime.today().strftime("%d.%m.%Y") - tweet = 'Pi-Hole-Statistik für den {date}:\n'.format(date=today) - tweet += 'Blockierte Werbung: ' + str(comma_value(data['ads_blocked_today'])) + tweet = 'Pi-hole statistics for {date}:\n'.format(date=today) + tweet += 'Ads Blocked: ' + str(comma_value(data['ads_blocked_today'])) tweet += ' (' + str(round(data['ads_percentage_today'], 2)).replace('.', ',') + ' %)\n' - tweet += 'DNS-Abfragen: ' + str(comma_value(data['dns_queries_today'])) + '\n' - tweet += 'Domains auf der Blacklist: ' + str(comma_value(data['domains_being_blocked'])) + tweet += 'Total DNS Queries: ' + str(comma_value(data['dns_queries_today'])) + '\n' + tweet += 'Domains on Blocklist: ' + str(comma_value(data['domains_being_blocked'])) return tweet