Add notice that the file is generated

Fixes #123
This commit is contained in:
Urtsi Santsi 2023-09-02 02:11:09 +03:00
parent 80cb57cb88
commit cf136ab09f
2 changed files with 11 additions and 2 deletions

View file

@ -25,9 +25,18 @@ from blueprintcompiler.language.types import ClassName
class XmlEmitter:
def __init__(self, indent=2):
def __init__(self, indent=2, generated_notice=True):
self.indent = indent
self.result = '<?xml version="1.0" encoding="UTF-8"?>'
if generated_notice:
self.result += (
"\n"
"<!--\n"
"DO NOT EDIT!\n"
"This file was @generated by blueprint-compiler. Instead, edit the\n"
"corresponding .blp file and regenerate this file with blueprint-compiler.\n"
"-->"
)
self._tag_stack = []
self._needs_newline = False