Skip to content

Commit

Permalink
Reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Feb 20, 2024
1 parent 7f93e99 commit 06f4952
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions amulet_nbt/_numeric.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ from ._value import AbstractBaseImmutableTag
class AbstractBaseNumericTag(AbstractBaseImmutableTag):
def __int__(self) -> int:
raise NotImplementedError

def __float__(self) -> float:
raise NotImplementedError

def __bool__(self) -> bool:
raise NotImplementedError
5 changes: 5 additions & 0 deletions amulet_nbt/_string.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ class StringTag(AbstractBaseImmutableTag):
def __init__(self, value: Any = ""): ...
def __contains__(self, o: str) -> bool:
raise NotImplementedError

def __eq__(self, x: object) -> bool:
raise NotImplementedError

def __getitem__(self, i: Union[int, slice]) -> str:
raise NotImplementedError

def __iter__(self) -> Iterator[str]:
raise NotImplementedError

def __len__(self) -> int:
raise NotImplementedError

@property
def py_str(self) -> str: ...
5 changes: 5 additions & 0 deletions amulet_nbt/_value.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,20 @@ class AbstractBaseTag(AbstractBase):
) -> bytes: ...
def __repr__(self) -> str:
raise NotImplementedError

def __str__(self) -> str:
raise NotImplementedError

def __eq__(self, other) -> bool:
raise NotImplementedError

def __reduce__(self):
raise NotImplementedError

def copy(self) -> AnyNBT: ...
def __deepcopy__(self, memo=None):
raise NotImplementedError

def __copy__(self):
raise NotImplementedError

Expand Down
1 change: 1 addition & 0 deletions template/tempita.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Cython has a template language called tempita.
This bakes the template files into real cython files."""

import glob
import os
import pkgutil
Expand Down
1 change: 1 addition & 0 deletions tests/binary_data/gen_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The printed result is used in test_nbt_read_write.py
This is here in case that data needs to be recreated in the future.
"""

from typing import Tuple, Type, Any, Iterable
from amulet_nbt import (
AbstractBaseTag,
Expand Down
4 changes: 2 additions & 2 deletions tests/tags/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def test_to_nbt(self):

# Test writing long strings
self.assertEqual(
b"\x08\x00\x00\xff\xff" + b"a"*65535,
StringTag("a"*65535).to_nbt(compressed=False)
b"\x08\x00\x00\xff\xff" + b"a" * 65535,
StringTag("a" * 65535).to_nbt(compressed=False),
)

with self.assertRaises(RuntimeError):
Expand Down

0 comments on commit 06f4952

Please sign in to comment.