From c2ed73bafc772826fbe63a2d0e1e6211ae87ffa4 Mon Sep 17 00:00:00 2001 From: git-sid <25916907+git-sid@users.noreply.github.com> Date: Thu, 13 Sep 2018 17:33:33 +0200 Subject: [PATCH] Make code more pep8 compliant --- active_bots/mastodonbot.py | 5 +++-- active_bots/telegrambot.py | 3 ++- frontend.py | 3 ++- report.py | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/active_bots/mastodonbot.py b/active_bots/mastodonbot.py index adfac48..5cf9cbc 100755 --- a/active_bots/mastodonbot.py +++ b/active_bots/mastodonbot.py @@ -21,7 +21,7 @@ class MastodonBot(Bot): try: m = Mastodon(*user.get_masto_credentials()) except TypeError: - #logger.error("No Mastodon Credentials in database.", exc_info=True) + # logger.error("No Mastodon Credentials in database.", exc_info=True) return mentions try: notifications = m.notifications() @@ -71,4 +71,5 @@ class MastodonBot(Bot): try: m.toot(text) except Exception: - logger.error('Error tooting: ' + user.get_city() + ': ' + report.id, exc_info=True) + logger.error('Error tooting: ' + user.get_city() + ': ' + + report.id, exc_info=True) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index e916943..dc8d921 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -34,7 +34,8 @@ class TelegramBot(Bot): # TODO: /help message should be set in frontend else: reports.append(Report(update.message.sender.username, self, - update.message.text, None, update.message.date)) + update.message.text, None, + update.message.date)) return reports def post(self, user, report): diff --git a/frontend.py b/frontend.py index 7b71ee6..45a1981 100755 --- a/frontend.py +++ b/frontend.py @@ -123,7 +123,7 @@ def unsubscribe(token): user = db.by_city(city) user.remove_subscriber(email) return city_page(city, info="You successfully unsubscribed " + email + - " from the mail notifications.") + " from the mail notifications.") @get('/settings') @@ -145,6 +145,7 @@ def update_mail_md(user): user.set_mail_md(request.forms['mail_md']) return user.state() + @post('/settings/goodlist') @view('template/settings.tpl') def update_trigger_patterns(user): diff --git a/report.py b/report.py index 5cf2c13..dc27003 100644 --- a/report.py +++ b/report.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 + class Report(object): """ A ticketfrei report object.