diff --git a/tools/run-mypy b/tools/run-mypy index 0484d65..1d75745 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -29,6 +29,10 @@ exclude = [ "zulip_bots/zulip_bots/terminal.py", "zulip_bots/zulip_bots/simple_lib.py", "zulip_bots/zulip_bots/tests/test_lib.py", + # Excluded because this is a self-contained script + # we ask our users to download and run directly and + # py2 and py3 compatibility is required. + "zulip/integrations/trello/zulip_trello.py", "tools", ] diff --git a/zulip/integrations/trello/__init__.py b/zulip/integrations/trello/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zulip/integrations/trello/zulip_trello.py b/zulip/integrations/trello/zulip_trello.py index e73ae00..6808ff9 100755 --- a/zulip/integrations/trello/zulip_trello.py +++ b/zulip/integrations/trello/zulip_trello.py @@ -5,12 +5,13 @@ from __future__ import absolute_import +from __future__ import print_function import sys import argparse import requests -def get_model_id(options: argparse.Namespace) -> str: +def get_model_id(options): """get_model_id Get Model Id from Trello API @@ -44,7 +45,7 @@ def get_model_id(options: argparse.Namespace) -> str: return board_info_json['id'] -def get_webhook_id(options: argparse.Namespace, id_model: str) -> str: +def get_webhook_id(options, id_model): """get_webhook_id Get webhook id from Trello API @@ -81,7 +82,7 @@ def get_webhook_id(options: argparse.Namespace, id_model: str) -> str: return webhook_info_json['id'] -def create_webhook(options: argparse.Namespace) -> None: +def create_webhook(options): """create_webhook Create Trello webhook @@ -106,8 +107,17 @@ def create_webhook(options: argparse.Namespace) -> None: print('Success! The webhook for the {} Trello board was successfully created.'.format( options.trello_board_name)) -def main() -> None: - parser = argparse.ArgumentParser() +def main(): + description = """ +zulip_trello.py is a handy little script that allows Zulip users to +quickly set up a Trello webhook. + +Note: The Trello webhook instructions available on your Zulip server +may be outdated. Please make sure you follow the updated instructions +at . +""" + + parser = argparse.ArgumentParser(description=description) parser.add_argument('--trello-board-name', required=True, help='The Trello board name.')