{{ after[:7] }}
to {% if 'refs/heads/' in ref %}branch {{ ref|replace('refs/heads/', '') }}{% else %}{{ ref }}{% endif %}:{{ after[:7] }}
to {% if 'refs/heads/' in ref %}branch {{ ref|replace('refs/heads/', '') }}{% else %}{{ ref }}{% endif %}:{{ checkout_sha[:7] }}
to {% if 'refs/heads/' in ref %}branch {{ ref|replace('refs/heads/', '') }}{% else %}{{ ref }}{% endif %}{{ c.id[:7] }}
{{ c.author.name }}: {{ c.title }}{{ commit.sha[:7] }}
"{{ commit.message|trim }}"){{ commit.id[:7] }}
"{{ commit.message|trim }}"){{ checkout_sha[:7] }}
to {% if 'refs/heads/' in ref %}branch {{ ref|replace('refs/heads/', '') }}{% else %}{{ ref }}{% endif %}{{ c.id[:7] }}
{{ c.author.name }}: {{ c.title }}{{ commit.sha[:7] }}
\"{{ commit.message|trim }}\"){{ commit.id[:7] }}
\"{{ commit.message|trim }}\"){json.dumps(post, sort_keys=False, indent=4)}\n
\n"
156 | post['format'] = 'html'
157 | else:
158 | template = env.from_string(webhook.template)
159 | payload = template.render(post)
160 |
161 | if len(payload) == 0:
162 | return Response(status_code=400)
163 |
164 | format = post.get('format') or webhook.defaultFormat
165 | if format not in ('plain', 'html'):
166 | template = env.from_string(format)
167 | format = template.render(post)
168 |
169 | avatar = None if urlparse(url=webhook.avatar).scheme not in ['http', 'https', 'mxc'] else webhook.avatar
170 |
171 | if webhook.defaultMsgtype != 'plain':
172 | msgtype = webhook.defaultMsgtype
173 | if post.get('msgtype') is not None:
174 | msgtype = post.get('msgtype')
175 | if msgtype is not None and msgtype not in ('text', 'notice', 'emote'):
176 | template = env.from_string(msgtype)
177 | msgtype = template.render(post)
178 |
179 | data = {
180 | "text": payload,
181 | "format": format,
182 | "displayName": webhook.displayName,
183 | "emoji": webhook.defaultEmoji if post.get('emoji') is None else post.get('emoji')
184 | }
185 | if avatar is not None:
186 | data['avatar_url'] = avatar
187 | data['avatarUrl'] = avatar
188 | if msgtype is not None:
189 | data['msgtype'] = msgtype
190 |
191 | response = requests.post(webhook.url + webhook.token, json=data)
192 | return response.json()
193 |
--------------------------------------------------------------------------------
/profiles.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
228 |
383 |
389 | Documentation and source
390 |
391 | API Documentation
392 |