From d15fd9497c61c0a6b66b64bc4776df075a268f4f Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Wed, 17 Jul 2024 09:09:34 +0100 Subject: [PATCH 1/2] Added functions to get source and include directories --- src/amulet_nbt/__init__.py | 8 ++++++++ src/amulet_nbt/__init__.pyi | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/amulet_nbt/__init__.py b/src/amulet_nbt/__init__.py index 803ffa76..07b60b96 100644 --- a/src/amulet_nbt/__init__.py +++ b/src/amulet_nbt/__init__.py @@ -10,11 +10,19 @@ def get_include() -> str: + """C++ include directory""" import os return os.path.join(__path__[0], "include") +def get_source() -> str: + """C++ source directory""" + import os + + return os.path.join(__path__[0], "cpp") + + from ._nbt import ( # Abstract classes AbstractBaseTag, diff --git a/src/amulet_nbt/__init__.pyi b/src/amulet_nbt/__init__.pyi index 5fe492b3..68edf2e1 100644 --- a/src/amulet_nbt/__init__.pyi +++ b/src/amulet_nbt/__init__.pyi @@ -75,8 +75,16 @@ __all__ = [ "EncodingPreset", "java_encoding", "bedrock_encoding", + "get_include", + "get_source", ] +def get_include() -> str: + ... + +def get_source() -> str: + ... + class _Readable(Protocol): def read(self) -> bytes: ... From aee0a6b90d32ae4db27d34d8d9550c3c1c9df223 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Wed, 17 Jul 2024 09:11:23 +0100 Subject: [PATCH 2/2] Reformatted --- src/amulet_nbt/__init__.pyi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/amulet_nbt/__init__.pyi b/src/amulet_nbt/__init__.pyi index 68edf2e1..7d82ebc2 100644 --- a/src/amulet_nbt/__init__.pyi +++ b/src/amulet_nbt/__init__.pyi @@ -79,11 +79,8 @@ __all__ = [ "get_source", ] -def get_include() -> str: - ... - -def get_source() -> str: - ... +def get_include() -> str: ... +def get_source() -> str: ... class _Readable(Protocol): def read(self) -> bytes: ...