gdnative_python/pythonscript/pandemonium/__init__.py

45 lines
1.3 KiB
Python
Raw Normal View History

2023-06-02 11:31:19 +02:00
# Start with a sanity check to ensure the loading is done from Pandemonium-Python
# (and not from a regular Python interpreter which would lead to a segfault).
# The idea is we should have the following loading order:
2023-06-02 11:13:10 +02:00
# pandemonium binary -> pythonscript.so -> _pandemonium.so -> pandemonium/__init__.py
import sys
2023-06-02 11:13:10 +02:00
if "_pandemonium" not in sys.modules:
raise ImportError(
2023-06-02 11:31:19 +02:00
"Cannot initialize pandemonium module given Pandemonium GDNative API not available.\n"
"This is most likely because you are running code from a regular Python interpreter"
2023-06-02 11:13:10 +02:00
" (i.e. doing something like `python my_script.py`) while pandemonium module is only available"
2023-06-02 11:31:19 +02:00
" to Python code loaded from Pandemonium through Pandemonium-Python plugin."
)
del sys
2023-06-02 11:13:10 +02:00
from pandemonium._version import __version__
from pandemonium.tags import (
MethodRPCMode,
PropertyHint,
PropertyUsageFlag,
rpcdisabled,
rpcremote,
rpcmaster,
rpcpuppet,
rpcslave,
rpcremotesync,
rpcsync,
rpcmastersync,
rpcpuppetsync,
signal,
export,
exposed,
)
2023-06-02 11:13:10 +02:00
from pandemonium.pool_arrays import (
PoolIntArray,
PoolRealArray,
PoolByteArray,
PoolVector2Array,
PoolVector3Array,
PoolColorArray,
PoolStringArray,
)
2023-06-02 11:13:10 +02:00
from pandemonium.builtins import *
from pandemonium.bindings import *