From fb539bb9e1d80470ad7cb04b6f6c971ad6b0b403 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 4 Feb 2025 19:11:35 -0500 Subject: [PATCH] Fixup comments and whitespace in generated Python code. (#2428) This is purely aesthetic and has no functional changes. --- .../bindings/python/templates/ExternalTemplate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uniffi_bindgen/src/bindings/python/templates/ExternalTemplate.py b/uniffi_bindgen/src/bindings/python/templates/ExternalTemplate.py index 313c0bc13e..a24aa03e07 100644 --- a/uniffi_bindgen/src/bindings/python/templates/ExternalTemplate.py +++ b/uniffi_bindgen/src/bindings/python/templates/ExternalTemplate.py @@ -1,20 +1,20 @@ {%- let namespace = ci.namespace_for_type(type_)? %} -{%- let module = python_config.module_for_namespace(namespace) -%} +{%- let module = python_config.module_for_namespace(namespace) %} # External type {{ name }}: `from {{ module }} import {{ name }}` {%- let ffi_converter_name = "_UniffiConverterType{}"|format(name) %} -{{ self.add_import_of(module, ffi_converter_name) }} -{{ self.add_import_of(module, name) }} {#- import the type alias itself -#} +{{- self.add_import_of(module, ffi_converter_name) }} +{{- self.add_import_of(module, name) }} {#- import the type alias itself -#} -# External type {{ name }} is an error. {%- if ci.is_name_used_as_error(name) %} +# External type {{ name }} is an error. {%- match type_ %} {%- when Type::Object { .. } %} {%- let err_ffi_converter_name = "{}__as_error"|format(ffi_converter_name) %} -{{ self.add_import_of(module, err_ffi_converter_name) }} +{{- self.add_import_of(module, err_ffi_converter_name) }} {%- else %} {%- endmatch %} {%- endif %} {%- let rustbuffer_local_name = "_UniffiRustBuffer{}"|format(name) %} -{{ self.add_import_of_as(module, "_UniffiRustBuffer", rustbuffer_local_name) }} +{{- self.add_import_of_as(module, "_UniffiRustBuffer", rustbuffer_local_name) }}