File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,17 @@ from pdk_types import <%- Object.values(schema.schemas).map(schema => schema.nam
1616# And it returns an output < %- toPythonType (imp .output ) % > (< %- formatCommentLine (imp .output .description ) % > )
1717< % } -% >
1818@extism .import_fn (" extism:host/user" , " <%- imp.name %>" )
19- def < %- camelToSnakeCase (imp .name ) % > (< % if (imp .input ) { -% > input: < %- toPythonType (imp .input ) % >< % } -% > ) < % if (imp .output ) { % > - > < %- toPythonType (imp .output ) % >< % } % > :
19+ def < %- camelToSnakeCase (imp .name ) % > (< % if (imp .input ) { -% > input: < %- toPythonType (imp .input ) % >< % } -% > ) < % if (imp .output ) { % > - > < %- toPythonType (imp .output ) % >< % } % > : # pyright : ignore [reportReturnType]
2020 pass
2121< % }) %>
2222
2323# Exports
24+ # The implementations for these functions is in `plugin.py`
2425
2526<% schema .exports .forEach (ex => { -% >
27+ < % if (hasComment (ex)) { -% >
28+ # < %- formatCommentBlock (ex .description , " # " ) % >
29+ < % } -% >
2630@extism .plugin_fn
2731def < %- ex .name % > ():
2832 res = plugin.< %- camelToSnakeCase (ex .name ) % > (< % if (ex .input ) { % > extism .input (< %- toPythonType (ex .input ) % > ) < % } % > )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ from pdk_types import <%- Object.values(schema.schemas).map(schema => schema.nam
1313# And it returns an output < %- toPythonType (imp .output ) % > (< %- formatCommentLine (imp .output .description ) % > )
1414< % } -% >
1515@extism .import_fn (" extism:host/user" , " <%- imp.name %>" )
16- def < %- camelToSnakeCase (imp .name ) % > (< % if (imp .input ) { -% > input: < %- toPythonType (imp .input ) % >< % } -% > ) < % if (imp .output ) { % > - > < %- toPythonType (imp .output ) % >< % } % > :
16+ def < %- camelToSnakeCase (imp .name ) % > (< % if (imp .input ) { -% > input: < %- toPythonType (imp .input ) % >< % } -% > ) < % if (imp .output ) { % > - > < %- toPythonType (imp .output ) % >< % } % > : # pyright : ignore [reportReturnType]
1717 pass
1818< % }) %>
1919
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ from pdk_imports import <%- schema.imports.map(schema => camelToSnakeCase(schema
44from typing import List, Optional # noqa: F401
55
66<% schema .exports .forEach (ex => { -% >
7+ < % if (hasComment (ex)) { -% >
8+ # < %- formatCommentBlock (ex .description , " # " ) % >
9+ < % } -% >
710def < %- camelToSnakeCase (ex .name ) % > (< % if (ex .input ) { % > input: < %- toPythonType (ex .input ) % > < % } % > ) < % if (ex .output ) {% > - > < %- toPythonType (ex .output ) % >< % }% > :
811< % if (featureFlags[' stub-with-code-samples' ] && codeSamples (ex, ' python' ).length > 0 ) { -% >
912 < %- codeSamples (ex, ' python' )[0 ].source % >
You can’t perform that action at this time.
0 commit comments