mirror of
https://github.com/Relintai/gdnative_python.git
synced 2025-01-19 15:07:17 +01:00
Mass replace godot to pandemonium pt2.
This commit is contained in:
parent
e9f699aabd
commit
179986074d
@ -3,7 +3,7 @@ current_version = 0.9.0
|
|||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
|
|
||||||
[bumpversion:file:pythonscript/cffi_bindings/mod_godot.inc.py]
|
[bumpversion:file:pythonscript/cffi_bindings/mod_pandemonium.inc.py]
|
||||||
search = __version__ = '{current_version}'
|
search = __version__ = '{current_version}'
|
||||||
replace = __version__ = '{new_version}'
|
replace = __version__ = '{new_version}'
|
||||||
|
|
||||||
|
8
.github/workflows_off/build.yml
vendored
8
.github/workflows_off/build.yml
vendored
@ -90,7 +90,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PLATFORM }}-release
|
name: ${{ env.PLATFORM }}-release
|
||||||
path: 'build/godot-python-*.tar.bz2'
|
path: 'build/pandemonium-python-*.tar.bz2'
|
||||||
|
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -166,7 +166,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.PLATFORM }}-release
|
name: ${{ matrix.PLATFORM }}-release
|
||||||
path: 'build/godot-python-*.zip'
|
path: 'build/pandemonium-python-*.zip'
|
||||||
|
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -217,7 +217,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
uses: actions/upload-artifact@11830c9f4d30053679cb8904e3b3ce1b8c00bf40 # pin@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PLATFORM }}-release
|
name: ${{ env.PLATFORM }}-release
|
||||||
path: 'build/godot-python-*.tar.bz2'
|
path: 'build/pandemonium-python-*.tar.bz2'
|
||||||
|
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -246,6 +246,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
file: godot-python-*.*
|
file: pandemonium-python-*.*
|
||||||
file_glob: true
|
file_glob: true
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
@ -13,7 +13,7 @@ EnsureSConsVersion(3, 0)
|
|||||||
def extract_version():
|
def extract_version():
|
||||||
# Hold my beer...
|
# Hold my beer...
|
||||||
gl = {}
|
gl = {}
|
||||||
exec(open("pythonscript/godot/_version.py").read(), gl)
|
exec(open("pythonscript/pandemonium/_version.py").read(), gl)
|
||||||
return gl["__version__"]
|
return gl["__version__"]
|
||||||
|
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ vars.Add(
|
|||||||
)
|
)
|
||||||
vars.Add("pytest_args", "Pytest arguments passed to tests functions", "")
|
vars.Add("pytest_args", "Pytest arguments passed to tests functions", "")
|
||||||
vars.Add(
|
vars.Add(
|
||||||
"pandemonium_args", "Additional arguments passed to godot binary when running tests&examples", ""
|
"pandemonium_args", "Additional arguments passed to pandemonium binary when running tests&examples", ""
|
||||||
)
|
)
|
||||||
vars.Add("release_suffix", "Suffix to add to the release archive", extract_version())
|
vars.Add("release_suffix", "Suffix to add to the release archive", extract_version())
|
||||||
vars.Add(
|
vars.Add(
|
||||||
@ -226,9 +226,9 @@ def generate_release(target, source, env):
|
|||||||
|
|
||||||
# Zip format doesn't support symlinks that are needed for Linux&macOS
|
# Zip format doesn't support symlinks that are needed for Linux&macOS
|
||||||
if env["platform"].startswith("windows"):
|
if env["platform"].startswith("windows"):
|
||||||
release_target = "build/godot-python-${release_suffix}-${platform}.zip"
|
release_target = "build/pandemonium-python-${release_suffix}-${platform}.zip"
|
||||||
else:
|
else:
|
||||||
release_target = "build/godot-python-${release_suffix}-${platform}.tar.bz2"
|
release_target = "build/pandemonium-python-${release_suffix}-${platform}.tar.bz2"
|
||||||
release = env.Command(release_target, env["DIST_ROOT"], generate_release)
|
release = env.Command(release_target, env["DIST_ROOT"], generate_release)
|
||||||
env.Alias("release", release)
|
env.Alias("release", release)
|
||||||
env.AlwaysBuild("release")
|
env.AlwaysBuild("release")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, InputEventKey, KEY_UP, KEY_DOWN, LineEdit
|
from pandemonium import exposed, InputEventKey, KEY_UP, KEY_DOWN, LineEdit
|
||||||
|
|
||||||
|
|
||||||
@exposed(tool=True)
|
@exposed(tool=True)
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
name="pythonscript_repl"
|
name="pythonscript_repl"
|
||||||
description=""
|
description=""
|
||||||
author="godot-python"
|
author="pandemonium-python"
|
||||||
version="0.1"
|
version="0.1"
|
||||||
script="plugin.py"
|
script="plugin.py"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, EditorPlugin, ProjectSettings, ResourceLoader
|
from pandemonium import exposed, EditorPlugin, ProjectSettings, ResourceLoader
|
||||||
|
|
||||||
|
|
||||||
BASE_RES = str(ProjectSettings.localize_path(__file__)).rsplit("/", 1)[0]
|
BASE_RES = str(ProjectSettings.localize_path(__file__)).rsplit("/", 1)[0]
|
||||||
|
@ -5,8 +5,8 @@ from collections import deque
|
|||||||
from threading import Thread, Lock, Event
|
from threading import Thread, Lock, Event
|
||||||
from queue import SimpleQueue
|
from queue import SimpleQueue
|
||||||
|
|
||||||
from _godot import StdoutStderrCaptureToGodot, StdinCapture
|
from _pandemonium import StdoutStderrCaptureToGodot, StdinCapture
|
||||||
from godot import exposed, export, ResourceLoader, VBoxContainer
|
from pandemonium import exposed, export, ResourceLoader, VBoxContainer
|
||||||
|
|
||||||
from .plugin import BASE_RES
|
from .plugin import BASE_RES
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, Vector2, Area2D
|
from pandemonium import exposed, Vector2, Area2D
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_SPEED = 220
|
DEFAULT_SPEED = 220
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from random import random
|
from random import random
|
||||||
|
|
||||||
from godot import exposed, export, Vector2, GDString, Area2D, Input
|
from pandemonium import exposed, export, Vector2, GDString, Area2D, Input
|
||||||
|
|
||||||
|
|
||||||
MOTION_SPEED = 150
|
MOTION_SPEED = 150
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, signal, export, Node2D
|
from pandemonium import exposed, signal, export, Node2D
|
||||||
|
|
||||||
|
|
||||||
SCORE_TO_WIN = 2
|
SCORE_TO_WIN = 2
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, rpcsync, Area2D, Vector2
|
from pandemonium import exposed, rpcsync, Area2D, Vector2
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_SPEED = 80
|
DEFAULT_SPEED = 80
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# /!\ Autogenerated code, modifications will be lost /!\
|
# /!\ Autogenerated code, modifications will be lost /!\
|
||||||
# see `generation/generate_bindings.py`
|
# see `generation/generate_bindings.py`
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport *
|
from pandemonium._hazmat.gdnative_api_struct cimport *
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot.builtins cimport *
|
from pandemonium.builtins cimport *
|
||||||
|
|
||||||
{% from 'class.tmpl.pxd' import render_class_pxd -%}
|
{% from 'class.tmpl.pxd' import render_class_pxd -%}
|
||||||
{%- for cls in classes %}
|
{%- for cls in classes %}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# (Note PEP484 state that import without as and * are not exposed by the stub file)
|
# (Note PEP484 state that import without as and * are not exposed by the stub file)
|
||||||
from typing import Any, Union
|
from typing import Any, Union
|
||||||
from enum import IntFlag
|
from enum import IntFlag
|
||||||
from godot.builtins import (
|
from pandemonium.builtins import (
|
||||||
AABB,
|
AABB,
|
||||||
Array,
|
Array,
|
||||||
Basis,
|
Basis,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# /!\ Autogenerated code, modifications will be lost /!\
|
# /!\ Autogenerated code, modifications will be lost /!\
|
||||||
# see `generation/generate_bindings.py`
|
# see `generation/generate_bindings.py`
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport *
|
from pandemonium._hazmat.gdnative_api_struct cimport *
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.conversion cimport *
|
from pandemonium._hazmat.conversion cimport *
|
||||||
from godot.builtins cimport *
|
from pandemonium.builtins cimport *
|
||||||
|
|
||||||
from enum import IntFlag
|
from enum import IntFlag
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ with nogil:
|
|||||||
# It's important to initialize this pointer to null given
|
# It's important to initialize this pointer to null given
|
||||||
# in case of Reference, Godot will try to decrease the
|
# in case of Reference, Godot will try to decrease the
|
||||||
# refcount if the pointer is valid !
|
# refcount if the pointer is valid !
|
||||||
# (see https://github.com/godotengine/godot/issues/35609)
|
# (see https://github.com/pandemoniumengine/pandemonium/issues/35609)
|
||||||
cdef pandemonium_object *{{ retval }} = NULL
|
cdef pandemonium_object *{{ retval }} = NULL
|
||||||
{% set retval_as_arg = "&{}".format(retval) %}
|
{% set retval_as_arg = "&{}".format(retval) %}
|
||||||
{% elif method.return_type.c_type == "pandemonium_variant" %}
|
{% elif method.return_type.c_type == "pandemonium_variant" %}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
cimport cython
|
cimport cython
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport *
|
from pandemonium._hazmat.gdnative_api_struct cimport *
|
||||||
from godot.pool_arrays cimport (
|
from pandemonium.pool_arrays cimport (
|
||||||
PoolIntArray,
|
PoolIntArray,
|
||||||
PoolRealArray,
|
PoolRealArray,
|
||||||
PoolByteArray,
|
PoolByteArray,
|
||||||
|
@ -5,14 +5,14 @@ from typing import Union
|
|||||||
|
|
||||||
cimport cython
|
cimport cython
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport *
|
from pandemonium._hazmat.gdnative_api_struct cimport *
|
||||||
from godot._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
pythonscript_gdapi11 as gdapi11,
|
||||||
pythonscript_gdapi12 as gdapi12,
|
pythonscript_gdapi12 as gdapi12,
|
||||||
)
|
)
|
||||||
from godot._hazmat.conversion cimport *
|
from pandemonium._hazmat.conversion cimport *
|
||||||
from godot.pool_arrays cimport (
|
from pandemonium.pool_arrays cimport (
|
||||||
PoolIntArray,
|
PoolIntArray,
|
||||||
PoolRealArray,
|
PoolRealArray,
|
||||||
PoolByteArray,
|
PoolByteArray,
|
||||||
|
@ -153,7 +153,7 @@ cdef class Dictionary:
|
|||||||
for k, v in other.items():
|
for k, v in other.items():
|
||||||
self[k] = v
|
self[k] = v
|
||||||
else:
|
else:
|
||||||
raise TypeError("other must be godot.Dictionary or dict")
|
raise TypeError("other must be pandemonium.Dictionary or dict")
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
cdef pandemonium_variant *p_key = NULL
|
cdef pandemonium_variant *p_key = NULL
|
||||||
@ -176,7 +176,7 @@ cdef class Dictionary:
|
|||||||
return dict(self) == dict(other)
|
return dict(self) == dict(other)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
{# see https://github.com/godotengine/godot/issues/27615 #}
|
{# see https://github.com/pandemoniumengine/pandemonium/issues/27615 #}
|
||||||
{{ force_mark_rendered("pandemonium_dictionary_operator_equal") }}
|
{{ force_mark_rendered("pandemonium_dictionary_operator_equal") }}
|
||||||
try:
|
try:
|
||||||
return Dictionary.operator_equal(self, <Dictionary?>other)
|
return Dictionary.operator_equal(self, <Dictionary?>other)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{%- block pxd_header %}
|
{%- block pxd_header %}
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
{%- block pyx_header %}
|
{%- block pyx_header %}
|
||||||
from godot.bindings cimport Resource
|
from pandemonium.bindings cimport Resource
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{%- block pxd_header %}
|
{%- block pxd_header %}
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
{%- block pyx_header %}
|
{%- block pyx_header %}
|
||||||
from godot._hazmat.gdnative_api_struct cimport pandemonium_vector3_axis
|
from pandemonium._hazmat.gdnative_api_struct cimport pandemonium_vector3_axis
|
||||||
|
|
||||||
import math
|
import math
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
@ -216,12 +216,12 @@ SUPPORTED_TYPES = {
|
|||||||
|
|
||||||
def pre_cook_patch_stuff(raw_data):
|
def pre_cook_patch_stuff(raw_data):
|
||||||
for klass in raw_data:
|
for klass in raw_data:
|
||||||
# see https://github.com/godotengine/godot/pull/40386
|
# see https://github.com/pandemoniumengine/pandemonium/pull/40386
|
||||||
if klass["name"] == "Reference":
|
if klass["name"] == "Reference":
|
||||||
klass["is_reference"] = True
|
klass["is_reference"] = True
|
||||||
for prop in klass["properties"]:
|
for prop in klass["properties"]:
|
||||||
prop["name"] = prop["name"].replace("/", "_")
|
prop["name"] = prop["name"].replace("/", "_")
|
||||||
# see https://github.com/godotengine/godot/pull/40383
|
# see https://github.com/pandemoniumengine/pandemonium/pull/40383
|
||||||
if prop["type"] == "17/17:RichTextEffect":
|
if prop["type"] == "17/17:RichTextEffect":
|
||||||
prop["type"] = "Array"
|
prop["type"] = "Array"
|
||||||
for meth in klass["methods"]:
|
for meth in klass["methods"]:
|
||||||
@ -239,7 +239,7 @@ def pre_cook_patch_stuff(raw_data):
|
|||||||
|
|
||||||
def post_cook_patch_stuff(classes):
|
def post_cook_patch_stuff(classes):
|
||||||
for klass in classes:
|
for klass in classes:
|
||||||
# See https://github.com/godotengine/godot/issues/34254
|
# See https://github.com/pandemoniumengine/pandemonium/issues/34254
|
||||||
if klass.name == "_OS":
|
if klass.name == "_OS":
|
||||||
for meth in klass.methods:
|
for meth in klass.methods:
|
||||||
if meth.name in (
|
if meth.name in (
|
||||||
@ -585,7 +585,7 @@ if __name__ == "__main__":
|
|||||||
raise argparse.ArgumentTypeError(f"Must have a `{suffix}` suffix")
|
raise argparse.ArgumentTypeError(f"Must have a `{suffix}` suffix")
|
||||||
return val[: -len(suffix)]
|
return val[: -len(suffix)]
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Generate godot api bindings bindings files")
|
parser = argparse.ArgumentParser(description="Generate pandemonium api bindings bindings files")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--input",
|
"--input",
|
||||||
"-i",
|
"-i",
|
||||||
|
@ -260,7 +260,7 @@ def load_builtins_specs_from_gdnative_api_json(gdnative_api: dict) -> List[Built
|
|||||||
revision_gdapi = f"gdapi{revision['version']['major']}{revision['version']['minor']}"
|
revision_gdapi = f"gdapi{revision['version']['major']}{revision['version']['minor']}"
|
||||||
for func in revision["api"]:
|
for func in revision["api"]:
|
||||||
assert func["name"] not in specs
|
assert func["name"] not in specs
|
||||||
# Ignore godot pool (generate by another script)
|
# Ignore pandemonium pool (generate by another script)
|
||||||
if func["name"].startswith("pandemonium_pool_") or func["name"].startswith("pandemonium_variant_"):
|
if func["name"].startswith("pandemonium_pool_") or func["name"].startswith("pandemonium_variant_"):
|
||||||
continue
|
continue
|
||||||
spec = load_builtin_method_spec(func, gdapi=revision_gdapi)
|
spec = load_builtin_method_spec(func, gdapi=revision_gdapi)
|
||||||
@ -372,7 +372,7 @@ if __name__ == "__main__":
|
|||||||
return val[: -len(suffix)]
|
return val[: -len(suffix)]
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Generate godot builtins bindings files (except pool arrays)"
|
description="Generate pandemonium builtins bindings files (except pool arrays)"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--input",
|
"--input",
|
||||||
|
@ -42,7 +42,7 @@ class CCCP:
|
|||||||
|
|
||||||
In the end remember that we are not compiling a C program, but creating a
|
In the end remember that we are not compiling a C program, but creating a
|
||||||
.pxd file that will (in conjuction with a .pyx) be used to generate a .c
|
.pxd file that will (in conjuction with a .pyx) be used to generate a .c
|
||||||
file that will include the godot api headers. So there is no need to handle
|
file that will include the pandemonium api headers. So there is no need to handle
|
||||||
platform specific (or even opaque structure size !) detail here: they will
|
platform specific (or even opaque structure size !) detail here: they will
|
||||||
be ignored by cython and left to the final C compilation.
|
be ignored by cython and left to the final C compilation.
|
||||||
"""
|
"""
|
||||||
|
@ -98,7 +98,7 @@ def generate_pool_array(output_path):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Generate godot pool_x_array builtins bindings files"
|
description="Generate pandemonium pool_x_array builtins bindings files"
|
||||||
)
|
)
|
||||||
parser.add_argument("--output", "-o", default=None)
|
parser.add_argument("--output", "-o", default=None)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
cimport cython
|
cimport cython
|
||||||
|
|
||||||
from godot._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
pythonscript_gdapi11 as gdapi11,
|
||||||
pythonscript_gdapi12 as gdapi12,
|
pythonscript_gdapi12 as gdapi12,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
{{ t.gd_value }},
|
{{ t.gd_value }},
|
||||||
{{ t.gd_pool }},
|
{{ t.gd_pool }},
|
||||||
@ -16,7 +16,7 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
{{ t.gd_pool }}_read_access,
|
{{ t.gd_pool }}_read_access,
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
)
|
)
|
||||||
from godot.builtins cimport (
|
from pandemonium.builtins cimport (
|
||||||
Array,
|
Array,
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
{% if not t.is_base_type %}
|
{% if not t.is_base_type %}
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
cimport cython
|
cimport cython
|
||||||
from libc.stdint cimport uintptr_t
|
from libc.stdint cimport uintptr_t
|
||||||
|
|
||||||
from godot._hazmat.gdapi cimport (
|
from pandemonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
pythonscript_gdapi11 as gdapi11,
|
||||||
pythonscript_gdapi12 as gdapi12,
|
pythonscript_gdapi12 as gdapi12,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
{{ t.gd_value }},
|
{{ t.gd_value }},
|
||||||
{{ t.gd_pool }},
|
{{ t.gd_pool }},
|
||||||
@ -17,7 +17,7 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
{{ t.gd_pool }}_read_access,
|
{{ t.gd_pool }}_read_access,
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
)
|
)
|
||||||
from godot.builtins cimport (
|
from pandemonium.builtins cimport (
|
||||||
Array,
|
Array,
|
||||||
{% for t in types %}
|
{% for t in types %}
|
||||||
{% if not t.is_base_type %}
|
{% if not t.is_base_type %}
|
||||||
|
@ -13,7 +13,7 @@ Introduction
|
|||||||
This is a beta version of the Python module for Godot.
|
This is a beta version of the Python module for Godot.
|
||||||
|
|
||||||
You are likely to encounter bugs and catastrophic crashes, if so please
|
You are likely to encounter bugs and catastrophic crashes, if so please
|
||||||
report them to https://github.com/touilleMan/godot-python/issues.
|
report them to https://github.com/Relintai/gdnative_python.
|
||||||
|
|
||||||
|
|
||||||
Working features
|
Working features
|
||||||
|
@ -11,11 +11,12 @@ Import("env")
|
|||||||
|
|
||||||
|
|
||||||
def resolve_pandemonium_download_url(major, minor, patch, extra, platform):
|
def resolve_pandemonium_download_url(major, minor, patch, extra, platform):
|
||||||
version = f"{major}.{minor}.{patch}" if patch != 0 else f"{major}.{minor}"
|
#version = f"{major}.{minor}.{patch}" if patch != 0 else f"{major}.{minor}"
|
||||||
if extra == "stable":
|
#if extra == "stable":
|
||||||
return f"https://downloads.tuxfamily.org/godotengine/{version}/Godot_v{version}-{extra}_{platform}.zip"
|
# return f"https://downloads.tuxfamily.org/godotengine/{version}/Godot_v{version}-{extra}_{platform}.zip"
|
||||||
else:
|
#else:
|
||||||
return f"https://downloads.tuxfamily.org/godotengine/{version}/{extra}/Godot_v{version}-{extra}_{platform}.zip"
|
# return f"https://downloads.tuxfamily.org/godotengine/{version}/{extra}/Godot_v{version}-{extra}_{platform}.zip"
|
||||||
|
returnf ""
|
||||||
|
|
||||||
|
|
||||||
def resolve_pandemonium_binary_name(major, minor, patch, extra, platform):
|
def resolve_pandemonium_binary_name(major, minor, patch, extra, platform):
|
||||||
|
@ -29,15 +29,15 @@ env.AppendUnique(LIBPATH=[Dir(".")])
|
|||||||
env.AppendUnique(CYTHON_COMPILE_DEPS=[libpythonscript])
|
env.AppendUnique(CYTHON_COMPILE_DEPS=[libpythonscript])
|
||||||
|
|
||||||
|
|
||||||
SConscript(["godot/SConscript"])
|
SConscript(["pandemoniummonium/SConscript"])
|
||||||
|
|
||||||
|
|
||||||
# `_pandemonium_api.h` is only for internal use between _godot and pythonscript
|
# `_pandemonium_api.h` is only for internal use between _pandemoniummonium and pythonscript
|
||||||
# libraries, hence no need to provide it as part of the release
|
# libraries, hence no need to provide it as part of the release
|
||||||
*mods, _ = env.CythonModule(
|
*mods, _ = env.CythonModule(
|
||||||
["_godot", "_pandemonium_api.h"],
|
["_pandemoniummonium", "_pandemonium_api.h"],
|
||||||
[
|
[
|
||||||
"_godot.pyx",
|
"_pandemoniummonium.pyx",
|
||||||
"_pandemonium_editor.pxi",
|
"_pandemonium_editor.pxi",
|
||||||
"_pandemonium_instance.pxi",
|
"_pandemonium_instance.pxi",
|
||||||
"_pandemonium_profiling.pxi",
|
"_pandemonium_profiling.pxi",
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
# `_godot` module contains all the callbacks needed by Godot's Pluginscript
|
# `_pandemoniummonium` module contains all the callbacks needed by Godot's Pluginscript
|
||||||
# system to expose Python as a language to Godot (see pythonscript.c for
|
# system to expose Python as a language to Godot (see pythonscript.c for
|
||||||
# more on this).
|
# more on this).
|
||||||
# Hence there is no point of importing this module from Python given it
|
# Hence there is no point of importing this module from Python given it
|
||||||
# only expose C functions.
|
# only expose C functions.
|
||||||
# Beside this module depend on the `godot.hazmat` module so it would be a bad
|
# Beside this module depend on the `pandemoniummonium.hazmat` module so it would be a bad
|
||||||
# idea to make the `godot` module depend on it...
|
# idea to make the `pandemoniummonium` module depend on it...
|
||||||
include "_pandemonium_editor.pxi"
|
include "_pandemonium_editor.pxi"
|
||||||
include "_pandemonium_profiling.pxi"
|
include "_pandemonium_profiling.pxi"
|
||||||
include "_pandemonium_script.pxi"
|
include "_pandemonium_script.pxi"
|
||||||
include "_pandemonium_instance.pxi"
|
include "_pandemonium_instance.pxi"
|
||||||
include "_pandemonium_io.pxi"
|
include "_pandemonium_io.pxi"
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemoniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_gdnative_init_options,
|
pandemonium_gdnative_init_options,
|
||||||
pandemonium_pluginscript_language_data,
|
pandemonium_pluginscript_language_data,
|
||||||
)
|
)
|
||||||
from godot._hazmat.internal cimport set_pythonscript_verbose, get_pythonscript_verbose
|
from pandemoniummonium._hazmat.internal cimport set_pythonscript_verbose, get_pythonscript_verbose
|
||||||
from godot.builtins cimport GDString
|
from pandemoniummonium.builtins cimport GDString
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# OS and ProjectSettings are singletons exposed as global python objects,
|
# OS and ProjectSettings are singletons exposed as global python objects,
|
||||||
# hence there are not available from a cimport
|
# hence there are not available from a cimport
|
||||||
from godot.bindings import OS, ProjectSettings
|
from pandemoniummonium.bindings import OS, ProjectSettings
|
||||||
from godot._version import __version__ as pythonscript_version
|
from pandemoniummonium._version import __version__ as pythonscript_version
|
||||||
|
|
||||||
|
|
||||||
def _setup_config_entry(name, default_value):
|
def _setup_config_entry(name, default_value):
|
||||||
@ -37,7 +37,7 @@ def _setup_config_entry(name, default_value):
|
|||||||
|
|
||||||
cdef api pandemonium_pluginscript_language_data *pythonscript_init() with gil:
|
cdef api pandemonium_pluginscript_language_data *pythonscript_init() with gil:
|
||||||
# Pass argv arguments
|
# Pass argv arguments
|
||||||
sys.argv = ["godot"] + [str(x) for x in OS.get_cmdline_args()]
|
sys.argv = ["pandemoniummonium"] + [str(x) for x in OS.get_cmdline_args()]
|
||||||
|
|
||||||
# Update PYTHONPATH according to configuration
|
# Update PYTHONPATH according to configuration
|
||||||
pythonpath = str(_setup_config_entry("python_script/path", "res://;res://lib"))
|
pythonpath = str(_setup_config_entry("python_script/path", "res://;res://lib"))
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from libc.stddef cimport wchar_t
|
from libc.stddef cimport wchar_t
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pannemdniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_pluginscript_language_data,
|
pandemonium_pluginscript_language_data,
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_bool,
|
pandemonium_bool,
|
||||||
@ -13,8 +13,8 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
pandemonium_error,
|
pandemonium_error,
|
||||||
pandemonium_dictionary
|
pandemonium_dictionary
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemoniummonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemoniummonium._hazmat.conversion cimport (
|
||||||
pandemonium_string_to_pyobj,
|
pandemonium_string_to_pyobj,
|
||||||
pyobj_to_pandemonium_string,
|
pyobj_to_pandemonium_string,
|
||||||
pandemonium_variant_to_pyobj,
|
pandemonium_variant_to_pyobj,
|
||||||
@ -32,8 +32,8 @@ cdef api pandemonium_string pythonscript_get_template_source_code(
|
|||||||
else:
|
else:
|
||||||
class_name = pandemonium_string_to_pyobj(p_class_name)
|
class_name = pandemonium_string_to_pyobj(p_class_name)
|
||||||
cdef str base_class_name = pandemonium_string_to_pyobj(p_base_class_name)
|
cdef str base_class_name = pandemonium_string_to_pyobj(p_base_class_name)
|
||||||
cdef str src = f"""from godot import exposed, export
|
cdef str src = f"""from pandemoniummonium import exposed, export
|
||||||
from godot import *
|
from pandemoniummonium import *
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
from libc.stddef cimport wchar_t
|
from libc.stddef cimport wchar_t
|
||||||
from cpython cimport Py_INCREF, Py_DECREF, PyObject
|
from cpython cimport Py_INCREF, Py_DECREF, PyObject
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemoniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_string_name,
|
pandemonium_string_name,
|
||||||
pandemonium_bool,
|
pandemonium_bool,
|
||||||
@ -18,8 +18,8 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
pandemonium_variant_call_error_error,
|
pandemonium_variant_call_error_error,
|
||||||
pandemonium_variant_type,
|
pandemonium_variant_type,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemoniummonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemoniummonium._hazmat.conversion cimport (
|
||||||
pandemonium_variant_to_pyobj,
|
pandemonium_variant_to_pyobj,
|
||||||
pyobj_to_pandemonium_variant,
|
pyobj_to_pandemonium_variant,
|
||||||
pandemonium_string_name_to_pyobj,
|
pandemonium_string_name_to_pyobj,
|
||||||
|
@ -4,12 +4,12 @@ import traceback
|
|||||||
from io import TextIOBase
|
from io import TextIOBase
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemoniummonium._hazmat.conversion cimport (
|
||||||
pandemonium_string_to_pyobj,
|
pandemonium_string_to_pyobj,
|
||||||
pyobj_to_pandemonium_string,
|
pyobj_to_pandemonium_string,
|
||||||
pandemonium_variant_to_pyobj,
|
pandemonium_variant_to_pyobj,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemoniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_string_name,
|
pandemonium_string_name,
|
||||||
pandemonium_bool,
|
pandemonium_bool,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# cython: c_string_type=unicode, c_string_encoding=utf8
|
# cython: c_string_type=unicode, c_string_encoding=utf8
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemoniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_pluginscript_language_data,
|
pandemonium_pluginscript_language_data,
|
||||||
pandemonium_pluginscript_profiling_data,
|
pandemonium_pluginscript_profiling_data,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemoniummonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
@ -4,7 +4,7 @@ import importlib
|
|||||||
|
|
||||||
from cpython.ref cimport PyObject
|
from cpython.ref cimport PyObject
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemoniummonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_pluginscript_language_data,
|
pandemonium_pluginscript_language_data,
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_bool,
|
pandemonium_bool,
|
||||||
@ -23,26 +23,26 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
GODOT_METHOD_FLAG_FROM_SCRIPT,
|
GODOT_METHOD_FLAG_FROM_SCRIPT,
|
||||||
GODOT_METHOD_RPC_MODE_DISABLED,
|
GODOT_METHOD_RPC_MODE_DISABLED,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemoniummonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemoniummonium._hazmat.conversion cimport (
|
||||||
pandemonium_string_to_pyobj,
|
pandemonium_string_to_pyobj,
|
||||||
pyobj_to_pandemonium_string,
|
pyobj_to_pandemonium_string,
|
||||||
pyobj_to_pandemonium_string_name,
|
pyobj_to_pandemonium_string_name,
|
||||||
pytype_to_pandemonium_type,
|
pytype_to_pandemonium_type,
|
||||||
)
|
)
|
||||||
from godot._hazmat.internal cimport (
|
from pandemoniummonium._hazmat.internal cimport (
|
||||||
get_pythonscript_verbose,
|
get_pythonscript_verbose,
|
||||||
get_exposed_class,
|
get_exposed_class,
|
||||||
set_exposed_class,
|
set_exposed_class,
|
||||||
destroy_exposed_class,
|
destroy_exposed_class,
|
||||||
)
|
)
|
||||||
from godot.bindings cimport _initialize_bindings, Object
|
from pandemoniummonium.bindings cimport _initialize_bindings, Object
|
||||||
from godot.builtins cimport Array, Dictionary
|
from pandemoniummonium.builtins cimport Array, Dictionary
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from godot.tags import ExportedField, SignalField
|
from pandemoniummonium.tags import ExportedField, SignalField
|
||||||
|
|
||||||
|
|
||||||
cdef inline pandemonium_pluginscript_script_manifest _build_empty_script_manifest():
|
cdef inline pandemonium_pluginscript_script_manifest _build_empty_script_manifest():
|
||||||
|
@ -14,11 +14,11 @@ pxds = [
|
|||||||
"pool_arrays.pxd",
|
"pool_arrays.pxd",
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot", [File("_version.py"), File("globals.py"), *pxds])
|
env.Install("$DIST_SITE_PACKAGES/pandemonium", [File("_version.py"), File("globals.py"), *pxds])
|
||||||
env.AppendUnique(CYTHON_DEPS=pxds)
|
env.AppendUnique(CYTHON_DEPS=pxds)
|
||||||
|
|
||||||
|
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot", env.CythonModule("tags", "tags.pyx"))
|
env.Install("$DIST_SITE_PACKAGES/pandemonium", env.CythonModule("tags", "tags.pyx"))
|
||||||
|
|
||||||
|
|
||||||
### Builtins ###
|
### Builtins ###
|
||||||
@ -49,8 +49,8 @@ env.Depends(
|
|||||||
env.Depends(pandemonium_builtins_srcs, pandemonium_pool_arrays_srcs)
|
env.Depends(pandemonium_builtins_srcs, pandemonium_pool_arrays_srcs)
|
||||||
|
|
||||||
|
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot", env.CythonModule("pool_arrays", "pool_arrays.pyx"))
|
env.Install("$DIST_SITE_PACKAGES/pandemonium", env.CythonModule("pool_arrays", "pool_arrays.pyx"))
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot", env.CythonModule("builtins", "builtins.pyx"))
|
env.Install("$DIST_SITE_PACKAGES/pandemonium", env.CythonModule("builtins", "builtins.pyx"))
|
||||||
|
|
||||||
|
|
||||||
### Bindings ###
|
### Bindings ###
|
||||||
@ -95,6 +95,6 @@ bindings_env.Depends(
|
|||||||
|
|
||||||
|
|
||||||
bindings_env.Install(
|
bindings_env.Install(
|
||||||
"$DIST_SITE_PACKAGES/godot", bindings_env.CythonModule("bindings", "bindings.pyx")
|
"$DIST_SITE_PACKAGES/pandemonium", bindings_env.CythonModule("bindings", "bindings.pyx")
|
||||||
)
|
)
|
||||||
bindings_env.Install("$DIST_SITE_PACKAGES/godot", "bindings.pyi")
|
bindings_env.Install("$DIST_SITE_PACKAGES/pandemonium", "bindings.pyi")
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
# Start with a sanity check to ensure the loading is done from Godot-Python
|
# Start with a sanity check to ensure the loading is done from Godot-Python
|
||||||
# (and not from a regular Python interpreter which would lead to a segfault).
|
# (and not from a regular Python interpreter which would lead to a segfault).
|
||||||
# The idea is we should have the following loading order:
|
# The idea is we should have the following loading order:
|
||||||
# godot binary -> pythonscript.so -> _godot.so -> godot/__init__.py
|
# pandemonium binary -> pythonscript.so -> _pandemonium.so -> pandemonium/__init__.py
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if "_godot" not in sys.modules:
|
if "_pandemonium" not in sys.modules:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"Cannot initialize godot module given Godot GDNative API not available.\n"
|
"Cannot initialize pandemonium module given Godot GDNative API not available.\n"
|
||||||
"This is most likely because you are running code from a regular Python interpreter"
|
"This is most likely because you are running code from a regular Python interpreter"
|
||||||
" (i.e. doing something like `python my_script.py`) while godot module is only available"
|
" (i.e. doing something like `python my_script.py`) while pandemonium module is only available"
|
||||||
" to Python code loaded from Godot through Godot-Python plugin."
|
" to Python code loaded from Godot through Godot-Python plugin."
|
||||||
)
|
)
|
||||||
del sys
|
del sys
|
||||||
|
|
||||||
from godot._version import __version__
|
from pandemonium._version import __version__
|
||||||
from godot.tags import (
|
from pandemonium.tags import (
|
||||||
MethodRPCMode,
|
MethodRPCMode,
|
||||||
PropertyHint,
|
PropertyHint,
|
||||||
PropertyUsageFlag,
|
PropertyUsageFlag,
|
||||||
@ -31,7 +31,7 @@ from godot.tags import (
|
|||||||
export,
|
export,
|
||||||
exposed,
|
exposed,
|
||||||
)
|
)
|
||||||
from godot.pool_arrays import (
|
from pandemonium.pool_arrays import (
|
||||||
PoolIntArray,
|
PoolIntArray,
|
||||||
PoolRealArray,
|
PoolRealArray,
|
||||||
PoolByteArray,
|
PoolByteArray,
|
||||||
@ -40,5 +40,5 @@ from godot.pool_arrays import (
|
|||||||
PoolColorArray,
|
PoolColorArray,
|
||||||
PoolStringArray,
|
PoolStringArray,
|
||||||
)
|
)
|
||||||
from godot.builtins import *
|
from pandemonium.builtins import *
|
||||||
from godot.bindings import *
|
from pandemonium.bindings import *
|
||||||
|
@ -12,10 +12,10 @@ pxds = [
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
env.AppendUnique(CYTHON_DEPS=pxds)
|
env.AppendUnique(CYTHON_DEPS=pxds)
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot/_hazmat", pxds)
|
env.Install("$DIST_SITE_PACKAGES/pandemonium/_hazmat", pxds)
|
||||||
|
|
||||||
|
|
||||||
### Generate godot api .h -> gdnative_api_struct.pxd ###
|
### Generate pandemonium api .h -> gdnative_api_struct.pxd ###
|
||||||
|
|
||||||
|
|
||||||
gdnative_api_struct_pxd = env.Command(
|
gdnative_api_struct_pxd = env.Command(
|
||||||
@ -28,6 +28,6 @@ gdnative_api_struct_pxd = env.Command(
|
|||||||
### Cython modules ###
|
### Cython modules ###
|
||||||
|
|
||||||
|
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot/_hazmat", env.CythonModule("conversion", "conversion.pyx"))
|
env.Install("$DIST_SITE_PACKAGES/pandemonium/_hazmat", env.CythonModule("conversion", "conversion.pyx"))
|
||||||
|
|
||||||
env.Install("$DIST_SITE_PACKAGES/godot/_hazmat", env.CythonModule("internal", "internal.pyx"))
|
env.Install("$DIST_SITE_PACKAGES/pandemonium/_hazmat", env.CythonModule("internal", "internal.pyx"))
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from libc.stddef cimport wchar_t
|
from libc.stddef cimport wchar_t
|
||||||
from libc.stdio cimport printf
|
from libc.stdio cimport printf
|
||||||
|
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_string_name,
|
pandemonium_string_name,
|
||||||
pandemonium_int,
|
pandemonium_int,
|
||||||
@ -10,7 +10,7 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
pandemonium_variant,
|
pandemonium_variant,
|
||||||
pandemonium_variant_type,
|
pandemonium_variant_type,
|
||||||
)
|
)
|
||||||
from godot.builtins cimport GDString, NodePath
|
from pandemonium.builtins cimport GDString, NodePath
|
||||||
|
|
||||||
|
|
||||||
# Godot string are basically a vector of wchar_t, each wchar_t representing
|
# Godot string are basically a vector of wchar_t, each wchar_t representing
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from libc.stddef cimport wchar_t
|
from libc.stddef cimport wchar_t
|
||||||
from libc.stdio cimport printf
|
from libc.stdio cimport printf
|
||||||
|
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_string,
|
pandemonium_string,
|
||||||
pandemonium_string_name,
|
pandemonium_string_name,
|
||||||
pandemonium_int,
|
pandemonium_int,
|
||||||
@ -10,8 +10,8 @@ from godot._hazmat.gdnative_api_struct cimport (
|
|||||||
pandemonium_variant,
|
pandemonium_variant,
|
||||||
pandemonium_variant_type,
|
pandemonium_variant_type,
|
||||||
)
|
)
|
||||||
from godot.bindings cimport Object
|
from pandemonium.bindings cimport Object
|
||||||
from godot.builtins cimport (
|
from pandemonium.builtins cimport (
|
||||||
Vector2,
|
Vector2,
|
||||||
Rect2,
|
Rect2,
|
||||||
Vector3,
|
Vector3,
|
||||||
@ -278,7 +278,7 @@ cdef inline RID _pandemonium_variant_to_pyobj_rid(const pandemonium_variant *p_g
|
|||||||
|
|
||||||
|
|
||||||
cdef inline Object _pandemonium_variant_to_pyobj_object(const pandemonium_variant *p_gdvar):
|
cdef inline Object _pandemonium_variant_to_pyobj_object(const pandemonium_variant *p_gdvar):
|
||||||
# TODO: This conversion relies on godot String and lookup into bindings
|
# TODO: This conversion relies on pandemonium String and lookup into bindings
|
||||||
# modules, wouldn't it be better to create a `ObjectFromVariant` lazy
|
# modules, wouldn't it be better to create a `ObjectFromVariant` lazy
|
||||||
# class instead ?
|
# class instead ?
|
||||||
return Object.cast_from_variant(p_gdvar)
|
return Object.cast_from_variant(p_gdvar)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_gdnative_core_api_struct,
|
pandemonium_gdnative_core_api_struct,
|
||||||
pandemonium_gdnative_core_1_1_api_struct,
|
pandemonium_gdnative_core_1_1_api_struct,
|
||||||
pandemonium_gdnative_core_1_2_api_struct,
|
pandemonium_gdnative_core_1_2_api_struct,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot.bindings cimport Object
|
from pandemonium.bindings cimport Object
|
||||||
|
|
||||||
|
|
||||||
cdef bint __pythonscript_verbose
|
cdef bint __pythonscript_verbose
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
from godot.bindings cimport Object
|
from pandemonium.bindings cimport Object
|
||||||
|
|
||||||
|
|
||||||
cdef bint __pythonscript_verbose = False
|
cdef bint __pythonscript_verbose = False
|
||||||
@ -35,11 +35,11 @@ cdef void set_exposed_class(object cls):
|
|||||||
cdef ModExposedClass mod
|
cdef ModExposedClass mod
|
||||||
cdef str modname = cls.__module__
|
cdef str modname = cls.__module__
|
||||||
|
|
||||||
# Use a threadlock to avoid data races in case godot loads/unloads scripts in multiple threads
|
# Use a threadlock to avoid data races in case pandemonium loads/unloads scripts in multiple threads
|
||||||
with __exposed_classes_lock:
|
with __exposed_classes_lock:
|
||||||
|
|
||||||
# We must keep track of reference counts for the module when reloading a script,
|
# We must keep track of reference counts for the module when reloading a script,
|
||||||
# godot calls pythonscript_script_init BEFORE pythonscript_script_finish
|
# pandemonium calls pythonscript_script_init BEFORE pythonscript_script_finish
|
||||||
# this happens because Godot can make multiple PluginScript instances for the same resource.
|
# this happens because Godot can make multiple PluginScript instances for the same resource.
|
||||||
|
|
||||||
# Godot calls
|
# Godot calls
|
||||||
@ -67,7 +67,7 @@ cdef void destroy_exposed_class(object cls):
|
|||||||
cdef ModExposedClass mod
|
cdef ModExposedClass mod
|
||||||
cdef str modname = cls.__module__
|
cdef str modname = cls.__module__
|
||||||
|
|
||||||
# Use a threadlock to avoid data races in case godot loads/unloads scripts in multiple threads
|
# Use a threadlock to avoid data races in case pandemonium loads/unloads scripts in multiple threads
|
||||||
with __exposed_classes_lock:
|
with __exposed_classes_lock:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -78,8 +78,8 @@ cdef void destroy_exposed_class(object cls):
|
|||||||
if mod.refcount == 1:
|
if mod.refcount == 1:
|
||||||
del __modules_with_exposed_class[modname]
|
del __modules_with_exposed_class[modname]
|
||||||
# Not safe to ever get rid of all references...
|
# Not safe to ever get rid of all references...
|
||||||
# see: https://github.com/touilleMan/godot-python/issues/170
|
# see: https://github.com/touilleMan/pandemonium-python/issues/170
|
||||||
# and: https://github.com/godotengine/godot/issues/10946
|
# and: https://github.com/pandemoniumengine/pandemonium/issues/10946
|
||||||
# sometimes script reloading craps out leaving dangling references
|
# sometimes script reloading craps out leaving dangling references
|
||||||
# __all_exposed_classes.remove(modname, cls)
|
# __all_exposed_classes.remove(modname, cls)
|
||||||
else:
|
else:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from _godot import __global_constants
|
from _pandemonium import __global_constants
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name):
|
def __getattr__(name):
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Public low-level APIs are exposed here
|
# Public low-level APIs are exposed here
|
||||||
|
|
||||||
from godot._hazmat cimport gdnative_api_struct
|
from pandemoniummonium._hazmat cimport gdnative_api_struct
|
||||||
# Re-expose Godot API with better names
|
# Re-expose Godot API with better names
|
||||||
from godot._hazmat.gdapi cimport (
|
from pandemoniummonium._hazmat.gdapi cimport (
|
||||||
pythonscript_gdapi10 as gdapi10,
|
pythonscript_gdapi10 as gdapi10,
|
||||||
pythonscript_gdapi11 as gdapi11,
|
pythonscript_gdapi11 as gdapi11,
|
||||||
pythonscript_gdapi12 as gdapi12,
|
pythonscript_gdapi12 as gdapi12,
|
||||||
@ -11,7 +11,7 @@ from godot._hazmat.gdapi cimport (
|
|||||||
pythonscript_gdapi_ext_android as gdapi_ext_android,
|
pythonscript_gdapi_ext_android as gdapi_ext_android,
|
||||||
pythonscript_gdapi_ext_arvr as gdapi_ext_arvr,
|
pythonscript_gdapi_ext_arvr as gdapi_ext_arvr,
|
||||||
)
|
)
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemonium._hazmat.conversion cimport (
|
||||||
pandemonium_string_to_pyobj,
|
pandemonium_string_to_pyobj,
|
||||||
pyobj_to_pandemonium_string,
|
pyobj_to_pandemonium_string,
|
||||||
pandemonium_variant_to_pyobj,
|
pandemonium_variant_to_pyobj,
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
import builtins
|
import builtins
|
||||||
import enum
|
import enum
|
||||||
|
|
||||||
from godot._hazmat.gdnative_api_struct cimport (
|
from pandemonium._hazmat.gdnative_api_struct cimport (
|
||||||
pandemonium_method_rpc_mode,
|
pandemonium_method_rpc_mode,
|
||||||
pandemonium_property_usage_flags,
|
pandemonium_property_usage_flags,
|
||||||
pandemonium_method_rpc_mode,
|
pandemonium_method_rpc_mode,
|
||||||
pandemonium_property_hint,
|
pandemonium_property_hint,
|
||||||
pandemonium_variant,
|
pandemonium_variant,
|
||||||
)
|
)
|
||||||
from godot._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
from pandemonium._hazmat.gdapi cimport pythonscript_gdapi10 as gdapi10
|
||||||
from godot._hazmat.conversion cimport (
|
from pandemonium._hazmat.conversion cimport (
|
||||||
is_pytype_compatible_with_pandemonium_variant,
|
is_pytype_compatible_with_pandemonium_variant,
|
||||||
pyobj_to_pandemonium_variant,
|
pyobj_to_pandemonium_variant,
|
||||||
pandemonium_variant_to_pyobj,
|
pandemonium_variant_to_pyobj,
|
||||||
)
|
)
|
||||||
from godot._hazmat.internal cimport get_exposed_class, set_exposed_class
|
from pandemonium._hazmat.internal cimport get_exposed_class, set_exposed_class
|
||||||
from godot.builtins cimport Array, Dictionary, GDString
|
from pandemonium.builtins cimport Array, Dictionary, GDString
|
||||||
from godot.bindings cimport Object, Resource
|
from pandemonium.bindings cimport Object, Resource
|
||||||
|
|
||||||
|
|
||||||
# Make Godot enums accesible from Python at runtime
|
# Make Godot enums accesible from Python at runtime
|
||||||
@ -250,7 +250,7 @@ def export(
|
|||||||
|
|
||||||
usage::
|
usage::
|
||||||
@exposed
|
@exposed
|
||||||
class CustomObject(godot.bindings.Object):
|
class CustomObject(pandemonium.bindings.Object):
|
||||||
a = export(str) # Expose attribute
|
a = export(str) # Expose attribute
|
||||||
b = export(int, default=42)
|
b = export(int, default=42)
|
||||||
|
|
||||||
@ -284,13 +284,13 @@ def exposed(cls=None, tool=False):
|
|||||||
usage::
|
usage::
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
class CustomObject(godot.bindings.Object):
|
class CustomObject(pandemonium.bindings.Object):
|
||||||
pass
|
pass
|
||||||
"""
|
"""
|
||||||
def wrapper(cls):
|
def wrapper(cls):
|
||||||
if not issubclass(cls, Object):
|
if not issubclass(cls, Object):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"{cls!r} must inherit from a Godot (e.g. `godot.bindings.Node`) "
|
f"{cls!r} must inherit from a Godot (e.g. `pandemonium.bindings.Node`) "
|
||||||
"class to be marked as @exposed"
|
"class to be marked as @exposed"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ static PyThreadState *gilstate = NULL;
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables exposing Godot API to the godot.hazmat cython module.
|
* Global variables exposing Godot API to the pandemonium.hazmat cython module.
|
||||||
* Hence we must initialized them before loading `_godot`/`godot` modules
|
* Hence we must initialized them before loading `_pandemonium`/`pandemonium` modules
|
||||||
* (which both depend on `godot.hazmat`).
|
* (which both depend on `pandemonium.hazmat`).
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define PYTHONSCRIPT_EXPORT __declspec(dllexport)
|
# define PYTHONSCRIPT_EXPORT __declspec(dllexport)
|
||||||
@ -184,16 +184,16 @@ GDN_EXPORT void pandemonium_gdnative_init(pandemonium_gdnative_init_options *opt
|
|||||||
// Py_SetPath(new_path);
|
// Py_SetPath(new_path);
|
||||||
// PyRun_SimpleString("import sys\nprint('PYTHON_PATH:', sys.path)\n");
|
// PyRun_SimpleString("import sys\nprint('PYTHON_PATH:', sys.path)\n");
|
||||||
|
|
||||||
Py_SetProgramName(L"godot");
|
Py_SetProgramName(L"pandemonium");
|
||||||
// Initialize interpreter but skip initialization registration of signal handlers
|
// Initialize interpreter but skip initialization registration of signal handlers
|
||||||
Py_InitializeEx(0);
|
Py_InitializeEx(0);
|
||||||
// PyEval_InitThreads acquires the GIL, so we must release it later.
|
// PyEval_InitThreads acquires the GIL, so we must release it later.
|
||||||
// Since python3.7 PyEval_InitThreads is automatically called by Py_InitializeEx, but it's better to leave it here
|
// Since python3.7 PyEval_InitThreads is automatically called by Py_InitializeEx, but it's better to leave it here
|
||||||
// to be explicit. Calling it again does nothing.
|
// to be explicit. Calling it again does nothing.
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
int ret = import__godot();
|
int ret = import__pandemonium();
|
||||||
if (ret != 0){
|
if (ret != 0){
|
||||||
GD_ERROR_PRINT("Cannot load godot python module");
|
GD_ERROR_PRINT("Cannot load pandemonium python module");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import OS, Node, Reference
|
from pandemonium import OS, Node, Reference
|
||||||
|
|
||||||
|
|
||||||
__global_objs = []
|
__global_objs = []
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import exposed, Node, OS
|
from pandemonium import exposed, Node, OS
|
||||||
|
|
||||||
|
|
||||||
__current_node = None
|
__current_node = None
|
||||||
@ -35,5 +35,5 @@ class Main(Node):
|
|||||||
print(f"running `pytest {' '.join(pytest_args)}`")
|
print(f"running `pytest {' '.join(pytest_args)}`")
|
||||||
if pytest.main(pytest_args):
|
if pytest.main(pytest_args):
|
||||||
OS.set_exit_code(1)
|
OS.set_exit_code(1)
|
||||||
# Exit godot
|
# Exit pandemonium
|
||||||
self.get_tree().quit()
|
self.get_tree().quit()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import AABB, Vector3, Plane
|
from pandemonium import AABB, Vector3, Plane
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import (
|
from pandemonium import (
|
||||||
GDString,
|
GDString,
|
||||||
Array,
|
Array,
|
||||||
Vector2,
|
Vector2,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Basis, Vector3, Quat
|
from pandemonium import Basis, Vector3, Quat
|
||||||
|
|
||||||
|
|
||||||
def test_default():
|
def test_default():
|
||||||
|
@ -2,8 +2,8 @@ import pytest
|
|||||||
from math import inf
|
from math import inf
|
||||||
from struct import unpack
|
from struct import unpack
|
||||||
|
|
||||||
import godot
|
import pandemonium
|
||||||
from godot import (
|
from pandemonium import (
|
||||||
Vector3,
|
Vector3,
|
||||||
GDString,
|
GDString,
|
||||||
NodePath,
|
NodePath,
|
||||||
@ -39,17 +39,17 @@ def test_free_node():
|
|||||||
|
|
||||||
|
|
||||||
def test_expose_contains_constant():
|
def test_expose_contains_constant():
|
||||||
assert "OK" in dir(godot)
|
assert "OK" in dir(pandemonium)
|
||||||
assert OK is not None
|
assert OK is not None
|
||||||
|
|
||||||
|
|
||||||
def test_expose_contains_class():
|
def test_expose_contains_class():
|
||||||
assert "Node" in dir(godot)
|
assert "Node" in dir(pandemonium)
|
||||||
assert Node is not None
|
assert Node is not None
|
||||||
|
|
||||||
|
|
||||||
def test_expose_contains_builtins():
|
def test_expose_contains_builtins():
|
||||||
assert "Vector3" in dir(godot)
|
assert "Vector3" in dir(pandemonium)
|
||||||
assert Vector3 is not None
|
assert Vector3 is not None
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ def test_call_none_in_bindings_args(current_node):
|
|||||||
current_node.get_path_to(None)
|
current_node.get_path_to(None)
|
||||||
assert (
|
assert (
|
||||||
str(exc.value)
|
str(exc.value)
|
||||||
== "Argument 'node' has incorrect type (expected godot.bindings.Node, got NoneType)"
|
== "Argument 'node' has incorrect type (expected pandemonium.bindings.Node, got NoneType)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Color, Vector2, GDString, Node
|
from pandemonium import Color, Vector2, GDString, Node
|
||||||
|
|
||||||
from conftest import generate_global_obj
|
from conftest import generate_global_obj
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from godot import Dictionary, Vector2, Array, GDString, Node, Resource, OS
|
from pandemonium import Dictionary, Vector2, Array, GDString, Node, Resource, OS
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# import pytest
|
# import pytest
|
||||||
|
|
||||||
# from godot.bindings import (
|
# from pandemonium.bindings import (
|
||||||
# Object,
|
# Object,
|
||||||
# Node,
|
# Node,
|
||||||
# Viewport,
|
# Viewport,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Vector3, NodePath, GDString
|
from pandemonium import Vector3, NodePath, GDString
|
||||||
|
|
||||||
|
|
||||||
def test_init():
|
def test_init():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Vector3, Plane
|
from pandemonium import Vector3, Plane
|
||||||
|
|
||||||
|
|
||||||
def test_init():
|
def test_init():
|
||||||
|
@ -4,7 +4,7 @@ from random import Random
|
|||||||
from inspect import isfunction
|
from inspect import isfunction
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from godot import (
|
from pandemonium import (
|
||||||
Array,
|
Array,
|
||||||
Vector2,
|
Vector2,
|
||||||
Vector3,
|
Vector3,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Basis, Quat, Vector3
|
from pandemonium import Basis, Quat, Vector3
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Rect2, Vector2
|
from pandemonium import Rect2, Vector2
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import RID, Environment, Node, OS
|
from pandemonium import RID, Environment, Node, OS
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# This test is in it own file to protect other tests from the `import *` side effects
|
# This test is in it own file to protect other tests from the `import *` side effects
|
||||||
from godot import *
|
from pandemonium import *
|
||||||
|
|
||||||
# Class with trailing underscore not are provided on star import
|
# Class with trailing underscore not are provided on star import
|
||||||
from godot.bindings import _OS, _ProjectSettings
|
from pandemonium.bindings import _OS, _ProjectSettings
|
||||||
|
|
||||||
|
|
||||||
def test_starimport():
|
def test_starimport():
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import GDString
|
from pandemonium import GDString
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# import pytest
|
# import pytest
|
||||||
|
|
||||||
# from godot import Array, Dictionary
|
# from pandemonium import Array, Dictionary
|
||||||
# from godot.hazmat.tools import (
|
# from pandemonium.hazmat.tools import (
|
||||||
# variant_to_pyobj,
|
# variant_to_pyobj,
|
||||||
# pyobj_to_variant,
|
# pyobj_to_variant,
|
||||||
# gdobj_to_pyobj,
|
# gdobj_to_pyobj,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Transform, Basis, Vector3
|
from pandemonium import Transform, Basis, Vector3
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Transform2D, Vector2, Rect2
|
from pandemonium import Transform2D, Vector2, Rect2
|
||||||
|
|
||||||
|
|
||||||
def test_init():
|
def test_init():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import Vector2
|
from pandemonium import Vector2
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
|
||||||
from godot import Vector3
|
from pandemonium import Vector3
|
||||||
|
|
||||||
|
|
||||||
def test_base():
|
def test_base():
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from godot import Node, exposed, export
|
from pandemonium import Node, exposed, export
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from godot.globals import global_gd, global_py
|
from pandemonium.globals import global_gd, global_py
|
||||||
|
|
||||||
global_import_outcome = "ok"
|
global_import_outcome = "ok"
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
global_import_outcome = (
|
global_import_outcome = (
|
||||||
f"Error doing `from godot.globals import global_gd, global_py` at module level: {exc!r}"
|
f"Error doing `from pandemonium.globals import global_gd, global_py` at module level: {exc!r}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -41,17 +41,17 @@ class access_from_python(Node):
|
|||||||
return
|
return
|
||||||
node.set_accessed("Python")
|
node.set_accessed("Python")
|
||||||
|
|
||||||
# Also test accessing from `godot.globals` module
|
# Also test accessing from `pandemonium.globals` module
|
||||||
if global_import_outcome != "ok":
|
if global_import_outcome != "ok":
|
||||||
self.outcome = global_import_outcome
|
self.outcome = global_import_outcome
|
||||||
return
|
return
|
||||||
|
|
||||||
from godot import globals as pandemonium_globals
|
from pandemonium import globals as pandemonium_globals
|
||||||
|
|
||||||
pandemonium_globals_dir = dir(pandemonium_globals)
|
pandemonium_globals_dir = dir(pandemonium_globals)
|
||||||
expected_pandemonium_globals_dir = ["global_gd", "global_py"]
|
expected_pandemonium_globals_dir = ["global_gd", "global_py"]
|
||||||
if pandemonium_globals_dir != expected_pandemonium_globals_dir:
|
if pandemonium_globals_dir != expected_pandemonium_globals_dir:
|
||||||
self.outcome = f"Invalid `dir(godot.globals)` (expected: `{expected_pandemonium_globals_dir}`, got `{pandemonium_globals_dir}`)"
|
self.outcome = f"Invalid `dir(pandemonium.globals)` (expected: `{expected_pandemonium_globals_dir}`, got `{pandemonium_globals_dir}`)"
|
||||||
return
|
return
|
||||||
for name, type in (("global_py", "Python"), ("global_gd", "GDScript")):
|
for name, type in (("global_py", "Python"), ("global_gd", "GDScript")):
|
||||||
node_from_globals = getattr(pandemonium_globals, name)
|
node_from_globals = getattr(pandemonium_globals, name)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import Node, exposed, export, Array
|
from pandemonium import Node, exposed, export, Array
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from godot import exposed, Node, OS
|
from pandemonium import exposed, Node, OS
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
@ -43,5 +43,5 @@ class Main(Node):
|
|||||||
|
|
||||||
if not ok:
|
if not ok:
|
||||||
OS.set_exit_code(1)
|
OS.set_exit_code(1)
|
||||||
# Exit godot
|
# Exit pandemonium
|
||||||
self.get_tree().quit()
|
self.get_tree().quit()
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
from godot import exposed
|
from pandemonium import exposed
|
||||||
from godot.bindings import Node, OS
|
from pandemonium.bindings import Node, OS
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
class Main(Node):
|
class Main(Node):
|
||||||
def _ready(self):
|
def _ready(self):
|
||||||
# Exit godot
|
# Exit pandemonium
|
||||||
OS.set_exit_code(0)
|
OS.set_exit_code(0)
|
||||||
self.get_tree().quit()
|
self.get_tree().quit()
|
||||||
|
@ -74,9 +74,9 @@ test_factory(
|
|||||||
"-c",
|
"-c",
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
import godot
|
import pandemonium
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
assert "Cannot initialize godot module given Godot GDNative API not available." in str(exc)
|
assert "Cannot initialize pandemonium module given Godot GDNative API not available." in str(exc)
|
||||||
""",
|
""",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import OS, Node, Reference
|
from pandemonium import OS, Node, Reference
|
||||||
|
|
||||||
|
|
||||||
__global_objs = []
|
__global_objs = []
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import exposed
|
from pandemonium import exposed
|
||||||
from godot.bindings import Node, OS
|
from pandemonium.bindings import Node, OS
|
||||||
|
|
||||||
|
|
||||||
__current_node = None
|
__current_node = None
|
||||||
@ -36,5 +36,5 @@ class Main(Node):
|
|||||||
print(f"running `pytest {' '.join(pytest_args)}`")
|
print(f"running `pytest {' '.join(pytest_args)}`")
|
||||||
if pytest.main(pytest_args):
|
if pytest.main(pytest_args):
|
||||||
OS.set_exit_code(1)
|
OS.set_exit_code(1)
|
||||||
# Exit godot
|
# Exit pandemonium
|
||||||
self.get_tree().quit()
|
self.get_tree().quit()
|
||||||
|
@ -16,7 +16,7 @@ _global_script_class_icons={
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
run/main_scene="res://main.tscn"
|
run/main_scene="res://main.tscn"
|
||||||
name="godot-threading-tests"
|
name="pandemonium-threading-tests"
|
||||||
main_scene="res://main.tscn"
|
main_scene="res://main.tscn"
|
||||||
|
|
||||||
[gdnative]
|
[gdnative]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from godot import Vector3, SurfaceTool, Mesh, MeshInstance
|
from pandemonium import Vector3, SurfaceTool, Mesh, MeshInstance
|
||||||
|
|
||||||
|
|
||||||
def test_simple_thread():
|
def test_simple_thread():
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import ResourceLoader
|
from pandemonium import ResourceLoader
|
||||||
|
|
||||||
import pymain
|
import pymain
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import exposed, Node, OS
|
from pandemonium import exposed, Node, OS
|
||||||
|
|
||||||
|
|
||||||
root_node = None
|
root_node = None
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, export, Node
|
from pandemonium import exposed, export, Node
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, ResourceLoader
|
from pandemonium import exposed, ResourceLoader
|
||||||
|
|
||||||
|
|
||||||
GDNode = ResourceLoader.load("res://gdnode.gd", "", False)
|
GDNode = ResourceLoader.load("res://gdnode.gd", "", False)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, export
|
from pandemonium import exposed, export
|
||||||
|
|
||||||
from pynode import PyNode
|
from pynode import PyNode
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from godot import exposed, export, Node2D
|
from pandemonium import exposed, export, Node2D
|
||||||
|
|
||||||
|
|
||||||
@exposed
|
@exposed
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# - overload native method ?
|
# - overload native method ?
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from godot import GDString, ResourceLoader, GDScript, PluginScript
|
from pandemonium import GDString, ResourceLoader, GDScript, PluginScript
|
||||||
|
|
||||||
|
|
||||||
def test_native_method(node):
|
def test_native_method(node):
|
||||||
|
@ -20,7 +20,7 @@ from zipfile import ZipFile
|
|||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
|
|
||||||
API_REPO_URL = "https://api.github.com/repos/touilleMan/godot-python/releases"
|
API_REPO_URL = "https://github.com/Relintai/gdnative_python/releases"
|
||||||
PLATFORMS = ("x11-32", "x11-64", "osx-64", "windows-32", "windows-64")
|
PLATFORMS = ("x11-32", "x11-64", "osx-64", "windows-32", "windows-64")
|
||||||
MISC_DIR = Path(__file__).parent / "../misc"
|
MISC_DIR = Path(__file__).parent / "../misc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user