This commit is contained in:
hhh
2024-02-02 22:41:44 +02:00
commit 81f77f8bc3
11 changed files with 108 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
/.idea/
/tests/
poetry.lock
*/__pycache__/

0
README.md Normal file
View File

View File

@@ -0,0 +1 @@
pass

View File

@@ -0,0 +1,4 @@
"""
The implementation structure (except for the neko folder)
differs from the standard structure
"""

View File

@@ -0,0 +1,15 @@
from neko_demo_standard import DemoInterface
class RDemoInterface(DemoInterface):
@staticmethod
def some_very_useful_method(very_important_arg: str = "h") -> None:
"""
It can be some adapter for internal logic
"""
print(very_important_arg)
DemoInterface = RDemoInterface
__all__ = ['DemoInterface']

View File

@@ -0,0 +1,24 @@
from neko_demo_standard.__internal.some_internal_logic_mixins import (
FirstAbstractMixin,
SecondAbstractMixin
)
from neko_demo_standard.neko.types import SomeDemoClass
class FirstMixin(FirstAbstractMixin):
def first_method(self):
print('first')
class SecondMixin(SecondAbstractMixin):
def second_method(self):
print('second')
class RSomeDemoClass(FirstMixin, SecondMixin, SomeDemoClass):
pass
SomeDemoClass = RSomeDemoClass
__all__ = ['SomeDemoClass']

View File

@@ -0,0 +1,27 @@
from neko_demo_standard.neko.types import SomeOtherDemoClass
class FirstMixin:
first = 'first'
def first_method(self):
print(self.first)
class SecondMixin:
second = 'second'
def second_method(self):
print(self.second)
class RSomeOtherDemoClass(FirstMixin, SecondMixin, SomeOtherDemoClass):
"""
Original SomeOtherDemoClass does not involve implementation with mixins,
but it is possible
"""
SomeOtherDemoClass = RSomeOtherDemoClass
__all__ = ['SomeOtherDemoClass']

View File

@@ -0,0 +1 @@
pass

View File

@@ -0,0 +1,4 @@
from ..modules.d import DemoInterface
__all__ = ['DemoInterface']

View File

@@ -0,0 +1,10 @@
from ..modules.dd import SomeDemoClass
from ..modules.ddd import SomeOtherDemoClass
__all__ = ['SomeDemoClass', 'SomeOtherDemoClass']
"""
Here, modules can be imported from internals of implementation, but they must be
present in the scope of the same (as in standard) file
"""

16
pyproject.toml Normal file
View File

@@ -0,0 +1,16 @@
[tool.poetry]
name = "neko-demo-impl"
version = "0.1.0"
description = ""
authors = ["hhh"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
neko-demo-standard = {git="https://github.com/nekomatad/neko-demo-standard.git"}
#neko-demo-standard = {path = "../neko-demo-standard", develop = true}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"