Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,10 @@ impl<'a> Summary<'a> {
alias_module: Option<String>,
}

let file_header = "# This file is automatically generated by componentize-py
# It is not intended for manual editing.
";

let mut interface_imports = HashMap::<InterfaceId, Definitions>::new();
let mut interface_exports = HashMap::<InterfaceId, Definitions>::new();
let mut world_imports = Definitions::default();
Expand Down Expand Up @@ -1799,7 +1803,7 @@ Result = peer.types.Result

write!(
file,
"{python_imports}
"{file_header}{python_imports}

S = TypeVar('S')
@dataclass
Expand Down Expand Up @@ -1853,7 +1857,7 @@ Result = Union[Ok[T], Err[E]]

write!(
file,
"{docs}{python_imports}
"{file_header}{docs}{python_imports}
from ..types import Result, Ok, Err, Some
{imports}
{types}
Expand Down Expand Up @@ -1884,7 +1888,7 @@ from ..types import Result, Ok, Err, Some

write!(
file,
"{docs}{python_imports}
"{file_header}{docs}{python_imports}
from ..types import Result, Ok, Err, Some
{imports}
{types}
Expand Down Expand Up @@ -1931,7 +1935,7 @@ class {camel}(Protocol):

write!(
init,
"{python_imports}
"{file_header}{python_imports}
from ..types import Result, Ok, Err, Some
{imports}
{protocols}
Expand Down Expand Up @@ -1983,7 +1987,7 @@ from ..types import Result, Ok, Err, Some

write!(
file,
"{docs}{python_imports}
"{file_header}{docs}{python_imports}
from .types import Result, Ok, Err, Some
{imports}
{type_exports}
Expand Down
Loading