From 5210e79dbd94590c912b56347490552d9e888a56 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Fri, 14 Sep 2018 17:48:54 -0230 Subject: [PATCH] integrations/trello: Stop logging to CSV file in Trello script. The information logged to the CSV file is largely redundant, since the ID of the webhook is already printed to the screen once a webhook is setup correctly. Since this is a script that the user is required to run once, we should minimize its reliance on external files as much as possible. This makes it easier to run the script when one is SSH-ing into a server and doesn't really care about where the script lives, for instance. --- zulip/integrations/trello/zulip_trello.py | 27 +------------------ .../trello/zulip_trello_webhooks.csv | 1 - 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 zulip/integrations/trello/zulip_trello_webhooks.csv diff --git a/zulip/integrations/trello/zulip_trello.py b/zulip/integrations/trello/zulip_trello.py index 5a95830..e73ae00 100755 --- a/zulip/integrations/trello/zulip_trello.py +++ b/zulip/integrations/trello/zulip_trello.py @@ -81,24 +81,6 @@ def get_webhook_id(options: argparse.Namespace, id_model: str) -> str: return webhook_info_json['id'] - -def log_webhook_info(options: argparse.Namespace, id_webhook: str) -> None: - """log_webhook_info - - Log webhook info in csv file for possible future use - - :options: argparse.Namespace arguments - :id_webhook: str Trello webhook id - """ - - with open('zulip_trello_webhooks.csv', 'a') as webhooks_file: - webhooks_file.write( - '{},{}\n'.format( - options.trello_board_name, - id_webhook - ) - ) - def create_webhook(options: argparse.Namespace) -> None: """create_webhook @@ -119,17 +101,10 @@ def create_webhook(options: argparse.Namespace) -> None: id_webhook = get_webhook_id(options, id_model) if id_webhook: - print('Success! The webhook id is', id_webhook) + print('Success! The webhook ID is', id_webhook) - # The webhook was successfully created, - # Log informations for possible future needs - print('Logging webhook information') - - log_webhook_info(options, id_webhook) print('Success! The webhook for the {} Trello board was successfully created.'.format( options.trello_board_name)) - print('\nYou can find the webhooks information in the zulip_trello_webhooks.csv file.') - def main() -> None: parser = argparse.ArgumentParser() diff --git a/zulip/integrations/trello/zulip_trello_webhooks.csv b/zulip/integrations/trello/zulip_trello_webhooks.csv deleted file mode 100644 index 585c171..0000000 --- a/zulip/integrations/trello/zulip_trello_webhooks.csv +++ /dev/null @@ -1 +0,0 @@ -trello_board_name,id_webhook