Skip to content

Commit 8ad03fa

Browse files
committed
chore: improve docstrings for python
1 parent dbb45a5 commit 8ad03fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

templates/python/package/services/service.py.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ class {{ service.name | caseUcfirst }}(Service):
2929
{% for method in service.methods %}
3030

3131
def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }}: {{ parameter | getPropertyType(method) | raw }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}):
32-
"""{{method.title}}"""
32+
"""
33+
{{ method.description }}
34+
35+
{% for parameter in method.parameters.all %}@param {{ parameter.name | escapeKeyword | caseSnake }}: {{ parameter.description }}
36+
{% endfor %}{% if 'multipart/form-data' in method.consumes %}@param on_progress: Optional callback for upload progress
37+
{% endif %}@raises AppwriteException: If API request fails
38+
"""
3339

3440
api_path = '{{ method.path }}'
3541
{{ include('python/base/params.twig') }}

0 commit comments

Comments
 (0)