Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

EnsureSConsVersion(4, 0)
Expand Down
2 changes: 2 additions & 0 deletions core/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/config/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/core_builders.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Functions used to generate source files during build time"""

from __future__ import annotations

import zlib


Expand Down
2 changes: 2 additions & 0 deletions core/crypto/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/debugger/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/error/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/extension/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/extension/make_interface_dumper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import zlib


Expand Down
2 changes: 2 additions & 0 deletions core/extension/make_wrappers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

proto_mod = """
#define MODBIND$VER($RETTYPE m_name$ARG) \\
virtual $RETVAL _##m_name($FUNCARGS) $CONST; \\
Expand Down
2 changes: 2 additions & 0 deletions core/input/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/input/input_builders.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Functions used to generate source files during build time"""

from __future__ import annotations

from collections import OrderedDict


Expand Down
2 changes: 2 additions & 0 deletions core/io/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/math/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/object/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/object/make_virtuals.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

proto = """#define GDVIRTUAL$VER($RET m_name $ARG)\\
StringName _gdvirtual_##m_name##_sn = #m_name;\\
mutable bool _gdvirtual_##m_name##_initialized = false;\\
Expand Down
2 changes: 2 additions & 0 deletions core/os/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/string/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/templates/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
2 changes: 2 additions & 0 deletions core/variant/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import annotations

from misc.utility.scons_hints import *

Import("env")
Expand Down
26 changes: 13 additions & 13 deletions doc/tools/doc_status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
from __future__ import annotations

import fnmatch
import math
Expand All @@ -7,7 +8,6 @@
import re
import sys
import xml.etree.ElementTree as ET
from typing import Dict, List, Set

################################################################################
# Config #
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self, described: int = 0, total: int = 0):
self.described: int = described
self.total: int = total

def __add__(self, other: "ClassStatusProgress"):
def __add__(self, other: ClassStatusProgress):
return ClassStatusProgress(self.described + other.described, self.total + other.total)

def increment(self, described: bool):
Expand Down Expand Up @@ -188,7 +188,7 @@ def __init__(self, name: str = ""):
self.name: str = name
self.has_brief_description: bool = True
self.has_description: bool = True
self.progresses: Dict[str, ClassStatusProgress] = {
self.progresses: dict[str, ClassStatusProgress] = {
"methods": ClassStatusProgress(),
"constants": ClassStatusProgress(),
"members": ClassStatusProgress(),
Expand All @@ -198,7 +198,7 @@ def __init__(self, name: str = ""):
"constructors": ClassStatusProgress(),
}

def __add__(self, other: "ClassStatus"):
def __add__(self, other: ClassStatus):
new_status = ClassStatus()
new_status.name = self.name
new_status.has_brief_description = self.has_brief_description and other.has_brief_description
Expand All @@ -223,8 +223,8 @@ def is_empty(self):
sum += self.progresses[k].total
return sum < 1

def make_output(self) -> Dict[str, str]:
output: Dict[str, str] = {}
def make_output(self) -> dict[str, str]:
output: dict[str, str] = {}
output["name"] = color("name", self.name)

ok_string = color("part_good", "OK")
Expand Down Expand Up @@ -305,8 +305,8 @@ def generate_for_class(c: ET.Element):
# Arguments #
################################################################################

input_file_list: List[str] = []
input_class_list: List[str] = []
input_file_list: list[str] = []
input_class_list: list[str] = []
merged_file: str = ""

for arg in sys.argv[1:]:
Expand Down Expand Up @@ -381,8 +381,8 @@ def generate_for_class(c: ET.Element):
# Parse class list #
################################################################################

class_names: List[str] = []
classes: Dict[str, ET.Element] = {}
class_names: list[str] = []
classes: dict[str, ET.Element] = {}

for file in input_file_list:
tree = ET.parse(file)
Expand All @@ -398,7 +398,7 @@ def generate_for_class(c: ET.Element):
if len(input_class_list) < 1:
input_class_list = ["*"]

filtered_classes_set: Set[str] = set()
filtered_classes_set: set[str] = set()
for pattern in input_class_list:
filtered_classes_set |= set(fnmatch.filter(class_names, pattern))
filtered_classes = list(filtered_classes_set)
Expand Down Expand Up @@ -428,7 +428,7 @@ def generate_for_class(c: ET.Element):
continue

out = status.make_output()
row: List[str] = []
row: list[str] = []
for column in table_columns:
if column in out:
row.append(out[column])
Expand Down Expand Up @@ -465,7 +465,7 @@ def generate_for_class(c: ET.Element):
# without having to scroll back to the top.
table.append(table_column_names)

table_column_sizes: List[int] = []
table_column_sizes: list[int] = []
for row in table:
for cell_i, cell in enumerate(row):
if cell_i >= len(table_column_sizes):
Expand Down
Loading