init
This commit is contained in:
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/.idea/
|
||||||
|
/tests/
|
||||||
|
|
||||||
|
poetry.lock
|
||||||
|
|
||||||
|
*/__pycache__/
|
||||||
1
neko_demo_impl/__init__.py
Normal file
1
neko_demo_impl/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pass
|
||||||
4
neko_demo_impl/modules/__init__.py
Normal file
4
neko_demo_impl/modules/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
"""
|
||||||
|
The implementation structure (except for the neko folder)
|
||||||
|
differs from the standard structure
|
||||||
|
"""
|
||||||
15
neko_demo_impl/modules/d.py
Normal file
15
neko_demo_impl/modules/d.py
Normal 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']
|
||||||
24
neko_demo_impl/modules/dd.py
Normal file
24
neko_demo_impl/modules/dd.py
Normal 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']
|
||||||
27
neko_demo_impl/modules/ddd.py
Normal file
27
neko_demo_impl/modules/ddd.py
Normal 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']
|
||||||
1
neko_demo_impl/neko/__init__.py
Normal file
1
neko_demo_impl/neko/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pass
|
||||||
4
neko_demo_impl/neko/interfaces.py
Normal file
4
neko_demo_impl/neko/interfaces.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
from ..modules.d import DemoInterface
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ['DemoInterface']
|
||||||
10
neko_demo_impl/neko/types.py
Normal file
10
neko_demo_impl/neko/types.py
Normal 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
16
pyproject.toml
Normal 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"
|
||||||
Reference in New Issue
Block a user