summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-03-09 14:29:24 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-03-09 14:29:24 -0600
commitd9fa40f2df44d775e82332577d44de402b23611f (patch)
treef9f95b4d52fbe79a9cd1ca1b0107b14cb7c9e45b /editor
parentf28964805e44a5c068ce8fd9d1e00697fcd922dc (diff)
downloadredot-engine-d9fa40f2df44d775e82332577d44de402b23611f.tar.gz
Enforce `\n` eol for Python writes
• Ensure utf-8 encoding if previously unspecified
Diffstat (limited to 'editor')
-rw-r--r--editor/SCsub4
-rw-r--r--editor/editor_builders.py4
-rw-r--r--editor/icons/editor_icons_builders.py2
-rw-r--r--editor/template_builders.py2
-rw-r--r--editor/themes/editor_theme_builders.py2
5 files changed, 7 insertions, 7 deletions
diff --git a/editor/SCsub b/editor/SCsub
index c88fd5e16a..67ded244cf 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -11,7 +11,7 @@ import editor_builders
def _make_doc_data_class_path(to_path):
# NOTE: It is safe to generate this file here, since this is still executed serially
- g = open(os.path.join(to_path, "doc_data_class_path.gen.h"), "w", encoding="utf-8")
+ g = open(os.path.join(to_path, "doc_data_class_path.gen.h"), "w", encoding="utf-8", newline="\n")
g.write("static const int _doc_data_class_path_count = " + str(len(env.doc_class_path)) + ";\n")
g.write("struct _DocDataClassPath { const char* name; const char* path; };\n")
@@ -41,7 +41,7 @@ if env.editor_build:
reg_exporters += "}\n"
# NOTE: It is safe to generate this file here, since this is still executed serially
- with open("register_exporters.gen.cpp", "w", encoding="utf-8") as f:
+ with open("register_exporters.gen.cpp", "w", encoding="utf-8", newline="\n") as f:
f.write(reg_exporters_inc)
f.write(reg_exporters)
diff --git a/editor/editor_builders.py b/editor/editor_builders.py
index 98a64cfd23..7cac984129 100644
--- a/editor/editor_builders.py
+++ b/editor/editor_builders.py
@@ -16,7 +16,7 @@ from platform_methods import subprocess_main
def make_doc_header(target, source, env):
dst = target[0]
- g = open(dst, "w", encoding="utf-8")
+ g = open(dst, "w", encoding="utf-8", newline="\n")
buf = ""
docbegin = ""
docend = ""
@@ -53,7 +53,7 @@ def make_doc_header(target, source, env):
def make_translations_header(target, source, env, category):
dst = target[0]
- g = open(dst, "w", encoding="utf-8")
+ g = open(dst, "w", encoding="utf-8", newline="\n")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef _{}_TRANSLATIONS_H\n".format(category.upper()))
diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py
index 378eb323db..4fe74881ed 100644
--- a/editor/icons/editor_icons_builders.py
+++ b/editor/icons/editor_icons_builders.py
@@ -85,7 +85,7 @@ def make_editor_icons_action(target, source, env):
s.write("#endif\n")
- with open(dst, "w") as f:
+ with open(dst, "w", encoding="utf-8", newline="\n") as f:
f.write(s.getvalue())
s.close()
diff --git a/editor/template_builders.py b/editor/template_builders.py
index efed567d46..d5932a08fe 100644
--- a/editor/template_builders.py
+++ b/editor/template_builders.py
@@ -85,7 +85,7 @@ def make_templates(target, source, env):
s.write("\n#endif\n")
- with open(dst, "w") as f:
+ with open(dst, "w", encoding="utf-8", newline="\n") as f:
f.write(s.getvalue())
s.close()
diff --git a/editor/themes/editor_theme_builders.py b/editor/themes/editor_theme_builders.py
index 19b346db58..b503c37c4b 100644
--- a/editor/themes/editor_theme_builders.py
+++ b/editor/themes/editor_theme_builders.py
@@ -12,7 +12,7 @@ from platform_methods import subprocess_main
def make_fonts_header(target, source, env):
dst = target[0]
- g = open(dst, "w", encoding="utf-8")
+ g = open(dst, "w", encoding="utf-8", newline="\n")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef _EDITOR_FONTS_H\n")