tools: Add support to generating bot avatars for non-webhook integrations.
New bot avatars are generated with this tool. Having the avatars generated, we can run generate-integration-docs-screenshot to generate the doc screenshots. Fixes: #17792
BIN
static/images/integrations/bot_avatars/GIPHY_big_logo.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/integrations/bot_avatars/asana.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
static/images/integrations/bot_avatars/assembla.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
static/images/integrations/bot_avatars/bigbluebutton.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
static/images/integrations/bot_avatars/bonusly.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
static/images/integrations/bot_avatars/capistrano.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
static/images/integrations/bot_avatars/chartbeat.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
static/images/integrations/bot_avatars/codebase.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
static/images/integrations/bot_avatars/darksky.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
static/images/integrations/bot_avatars/discourse.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
static/images/integrations/bot_avatars/email.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/images/integrations/bot_avatars/errbot.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
static/images/integrations/bot_avatars/git.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
static/images/integrations/bot_avatars/github-actions.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/images/integrations/bot_avatars/google-calendar.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/images/integrations/bot_avatars/google-translate.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
static/images/integrations/bot_avatars/hubot.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
static/images/integrations/bot_avatars/instagra_m.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
static/images/integrations/bot_avatars/irc.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
static/images/integrations/bot_avatars/jenkins.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
static/images/integrations/bot_avatars/jitsi.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
static/images/integrations/bot_avatars/logo.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
static/images/integrations/bot_avatars/mailchimp.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
static/images/integrations/bot_avatars/matrix.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
static/images/integrations/bot_avatars/mercurial.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
static/images/integrations/bot_avatars/nagios.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/integrations/bot_avatars/openshift.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
static/images/integrations/bot_avatars/perforce.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/images/integrations/bot_avatars/phabricator.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
static/images/integrations/bot_avatars/puppet.png
Normal file
|
After Width: | Height: | Size: 891 B |
BIN
static/images/integrations/bot_avatars/redmine.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
static/images/integrations/bot_avatars/rss.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
static/images/integrations/bot_avatars/svn.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
static/images/integrations/bot_avatars/trac.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
static/images/integrations/bot_avatars/twitte_r.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
static/images/integrations/bot_avatars/youtub_e.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/images/integrations/bot_avatars/zoom.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
@@ -19,7 +19,7 @@ django.setup()
|
||||
import cairosvg
|
||||
from PIL import Image
|
||||
|
||||
from zerver.lib.integrations import WEBHOOK_INTEGRATIONS
|
||||
from zerver.lib.integrations import INTEGRATIONS
|
||||
from zerver.lib.storage import static_path
|
||||
from zerver.lib.upload import DEFAULT_AVATAR_SIZE, resize_avatar
|
||||
|
||||
@@ -57,20 +57,20 @@ def create_integration_bot_avatar(logo_path: str, bot_avatar_path: str) -> None:
|
||||
|
||||
def generate_integration_bots_avatars(check_missing: bool = False) -> None:
|
||||
missing = set()
|
||||
for webhook in WEBHOOK_INTEGRATIONS:
|
||||
if not webhook.logo_path:
|
||||
for integration in INTEGRATIONS.values():
|
||||
if not integration.logo_path:
|
||||
continue
|
||||
|
||||
bot_avatar_path = webhook.get_bot_avatar_path()
|
||||
bot_avatar_path = integration.get_bot_avatar_path()
|
||||
if bot_avatar_path is None:
|
||||
continue
|
||||
|
||||
bot_avatar_path = os.path.join(ZULIP_PATH, "static", bot_avatar_path)
|
||||
if check_missing:
|
||||
if not os.path.isfile(bot_avatar_path):
|
||||
missing.add(webhook.name)
|
||||
missing.add(integration.name)
|
||||
else:
|
||||
create_integration_bot_avatar(static_path(webhook.logo_path), bot_avatar_path)
|
||||
create_integration_bot_avatar(static_path(integration.logo_path), bot_avatar_path)
|
||||
|
||||
if missing:
|
||||
print(
|
||||
|
||||