Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5210e79

Browse files
committed
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.
1 parent 1de6613 commit 5210e79

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

zulip/integrations/trello/zulip_trello.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,6 @@ def get_webhook_id(options: argparse.Namespace, id_model: str) -> str:
8181

8282
return webhook_info_json['id']
8383

84-
85-
def log_webhook_info(options: argparse.Namespace, id_webhook: str) -> None:
86-
"""log_webhook_info
87-
88-
Log webhook info in csv file for possible future use
89-
90-
:options: argparse.Namespace arguments
91-
:id_webhook: str Trello webhook id
92-
"""
93-
94-
with open('zulip_trello_webhooks.csv', 'a') as webhooks_file:
95-
webhooks_file.write(
96-
'{},{}\n'.format(
97-
options.trello_board_name,
98-
id_webhook
99-
)
100-
)
101-
10284
def create_webhook(options: argparse.Namespace) -> None:
10385
"""create_webhook
10486
@@ -119,17 +101,10 @@ def create_webhook(options: argparse.Namespace) -> None:
119101
id_webhook = get_webhook_id(options, id_model)
120102

121103
if id_webhook:
122-
print('Success! The webhook id is', id_webhook)
104+
print('Success! The webhook ID is', id_webhook)
123105

124-
# The webhook was successfully created,
125-
# Log informations for possible future needs
126-
print('Logging webhook information')
127-
128-
log_webhook_info(options, id_webhook)
129106
print('Success! The webhook for the {} Trello board was successfully created.'.format(
130107
options.trello_board_name))
131-
print('\nYou can find the webhooks information in the zulip_trello_webhooks.csv file.')
132-
133108

134109
def main() -> None:
135110
parser = argparse.ArgumentParser()

zulip/integrations/trello/zulip_trello_webhooks.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)