Skip to content

Commit 4131c4b

Browse files
committed
chore: added numpy style docstring
1 parent 8ad03fa commit 4131c4b

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function getSSLPage($url) {
4242
$platform = 'console';
4343
// $platform = 'server';
4444

45-
$spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/1.6.x/app/config/specs/swagger2-latest-{$platform}.json");
45+
$spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/pla-2684/app/config/specs/swagger2-latest-{$platform}.json");
4646

4747
if(empty($spec)) {
4848
throw new Exception('Failed to fetch spec from Appwrite server');

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,27 @@ class {{ service.name | caseUcfirst }}(Service):
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 %}):
3232
"""
33-
{{ method.description }}
33+
{{ method.description | replace({"\n": "\n "}) }}
34+
{% if method.parameters.all|length > 0 or 'multipart/form-data' in method.consumes %}
3435

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
36+
Parameters
37+
----------
38+
{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }} : {{ parameter | getPropertyType(method) | raw }}
39+
{{ parameter.description | replace({"\n": "\n "}) }}
40+
{% endfor %}{% if 'multipart/form-data' in method.consumes %}
41+
on_progress : callable, optional
42+
Optional callback for upload progress
43+
{% endif %}{% endif %}
44+
45+
Returns
46+
-------
47+
dict
48+
API response as a dictionary
49+
50+
Raises
51+
------
52+
AppwriteException
53+
If API request fails
3854
"""
3955

4056
api_path = '{{ method.path }}'

0 commit comments

Comments
 (0)