From e0cafd1fdb93fef9e503f89870c0862c7763b7e1 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Tue, 15 Aug 2017 20:51:41 -0230 Subject: [PATCH] zulip_bots: Add function to get path to a bot's doc.md file. This is part of our efforts to have the documentation for a particular bot live in this repo but still be able to render it in the main repo (in a way similar to how we render the webhooks docs). This function allows us to specify the path to a bot's doc.md file in zerver.lib.integrations.BotIntegration. --- zulip_bots/zulip_bots/lib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 493ab39..edfb797 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -40,6 +40,10 @@ def get_bots_directory_path(): current_dir = os.path.dirname(os.path.abspath(__file__)) return os.path.join(current_dir, 'bots') +def get_bot_doc_path(name): + # type: (str) -> str + return os.path.join(get_bots_directory_path(), '{}/doc.md'.format(name)) + class RateLimit(object): def __init__(self, message_limit, interval_limit): # type: (int, int) -> None