Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit dc03d22

Browse files
committed
Add blocks
1 parent fd912fe commit dc03d22

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/betterproto2_compiler/templates/service_stub.py.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
class {% block class_name %}{% endblock %}({% block inherit_from %}{% endblock %}):
2+
{% block service_docstring scoped %}
23
{% if service.comment %}
34
"""
45
{{ service.comment | indent(4) }}
56
"""
67
{% elif not service.methods %}
78
pass
89
{% endif %}
10+
{% endblock %}
911

1012
{% block class_content %}{% endblock %}
1113

1214
{% for method in service.methods %}
1315
{% block method_definition scoped required %}{% endblock %}
16+
{% block method_docstring scoped %}
1417
{% if method.comment %}
1518
"""
1619
{{ method.comment | indent(8) }}
1720
"""
1821
{% endif %}
22+
{% endblock %}
1923

24+
{% block deprecation_warning scoped %}
2025
{% if method.deprecated %}
2126
warnings.warn("{{ service.py_name }}.{{ method.py_name }} is deprecated", DeprecationWarning)
2227
{% endif %}
28+
{% endblock %}
2329

2430
{% if method.server_streaming %}
2531
{% if method.client_streaming %}

0 commit comments

Comments
 (0)