init
This commit is contained in:
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
|
||||
"""
|
||||
Reference in New Issue
Block a user