Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
refactor: Relocate screenshots scripts to new tools/screenshots dir.
roanster0070a7c0ea32627
diff --git a/api_docs/incoming-webhooks-overview.md b/api_docs/incoming-webhooks-overview.mdindex b423e31bf0d..840df6a91f1 100644--- a/api_docs/incoming-webhooks-overview.md+++ b/api_docs/incoming-webhooks-overview.md@@ -97,7 +97,7 @@ below are for a webhook named `MyWebHook`.pages as well as the sender's avatar for messages sent by the integration.* `static/images/integrations/mywebhook/001.png`: A screenshot of a messagesent by the integration, used on the documentation page. This can be- generated by running `tools/generate-integration-docs-screenshot --integration mywebhook`.+ generated by running `tools/screenshots/generate-integration-docs-screenshot --integration mywebhook`.* `static/images/integrations/bot_avatars/mywebhook.png`: A square logo for theplatform/server/product you are integrating which is used to create the avatarfor generating screenshots with. This can be generated automatically from@@ -113,7 +113,7 @@ below are for a webhook named `MyWebHook`.`zerver/webhooks/mywebhook/view.py`. Also add your integration to`DOC_SCREENSHOT_CONFIG`. This will allow you to automatically generatea screenshot for the documentation by running- `tools/generate-integration-docs-screenshot --integration mywebhook`.+ `tools/screenshots/generate-integration-docs-screenshot --integration mywebhook`.## Common Helpersdiff --git a/docs/documentation/integrations.md b/docs/documentation/integrations.mdindex 56792ed47c4..9c45bcceec8 100644--- a/docs/documentation/integrations.md+++ b/docs/documentation/integrations.md@@ -44,10 +44,10 @@ Usually, this involves a few steps:the message to provide an example message in the documentation.If your new integration is an incoming webhook integration, you can generate- the screenshot using `tools/generate-integration-docs-screenshot`:+ the screenshot using `tools/screenshots/generate-integration-docs-screenshot`:```bash- ./tools/generate-integration-docs-screenshot --integration integrationname+ ./tools/screenshots/generate-integration-docs-screenshot --integration integrationname```If you have trouble using this tool, you can also manually generate thediff --git a/tools/generate-integration-docs-screenshot b/tools/screenshots/generate-integration-docs-screenshotsimilarity index 98%rename from tools/generate-integration-docs-screenshotrename to tools/screenshots/generate-integration-docs-screenshotindex a81a966250d..6b9fee808af 100755--- a/tools/generate-integration-docs-screenshot+++ b/tools/screenshots/generate-integration-docs-screenshot@@ -9,7 +9,8 @@ import sysfrom typing import Any, Dict, Optional, Tuplefrom urllib.parse import parse_qsl, urlencode-TOOLS_DIR = os.path.abspath(os.path.dirname(__file__))+SCREENSHOTS_DIR = os.path.abspath(os.path.dirname(__file__))+TOOLS_DIR = os.path.abspath(os.path.dirname(SCREENSHOTS_DIR))ROOT_DIR = os.path.dirname(TOOLS_DIR)sys.path.insert(0, ROOT_DIR)@@ -225,7 +226,7 @@ def capture_last_message_screenshot(bot: UserProfile, image_path: str) -> None:print(f"No message found for {bot.full_name}")returnmessage_id = str(message.id)- screenshot_script = os.path.join(TOOLS_DIR, "message-screenshot.js")+ screenshot_script = os.path.join(SCREENSHOTS_DIR, "message-screenshot.js")subprocess.check_call(["node", screenshot_script, message_id, image_path, realm.url])diff --git a/tools/message-screenshot.js b/tools/screenshots/message-screenshot.jssimilarity index 100%rename from tools/message-screenshot.jsrename to tools/screenshots/message-screenshot.jsdiff --git a/zerver/tests/test_integrations.py b/zerver/tests/test_integrations.pyindex 8ececba3492..a12f128e149 100644--- a/zerver/tests/test_integrations.py+++ b/zerver/tests/test_integrations.py@@ -62,7 +62,7 @@ class IntegrationsTestCase(ZulipTestCase):message = ('"{path}" does not exist for webhook {webhook_name}.\n'"Consider updating zerver.lib.integrations.DOC_SCREENSHOT_CONFIG\n"- 'and running "tools/generate-integration-docs-screenshot" to keep the screenshots up-to-date.'+ 'and running "tools/screenshots/generate-integration-docs-screenshot" to keep the screenshots up-to-date.')for integration_name in DOC_SCREENSHOT_CONFIG:configs = DOC_SCREENSHOT_CONFIG[integration_name]