Snake Nest
Project description
SnakeNest
from snakenest import *
@Snake(args={"val1": "10", "val2": "22"})
class Config:
def __init__(self, val1, val2):
self.val1 = val1
self.val2 = val2
def get_val1(self):
return self.val1
def get_val2(self):
return self.val2
@Snake()
class Test:
@Poisoned()
def __init__(self, config: Config):
self.__config = config
print(f'Test: {self.__config.__dict__}')
def hello(self, name):
return f"Test: Hello {name}"
def getName(self):
return "test_name"
@Snake(name='testName', args={"q": "10", "b": "22"})
class Pollo:
def __init__(self, q, b):
self.q, self.b = q, b
def hello(self, name):
return f"Test_named: Hello {name}"
def getName(self):
return f'Pollo -> TestNamed: {self.q} - {self.b}'
class Test2:
@Poisoned()
def __init__(self, config: Config):
self.__config = config
print(f'Test2: {self.__config.__dict__}')
@Poisoned()
def getTestName(self, panico, name: Test):
return name.hello(panico)
@Poisoned(name='testName')
def getTestName2(self, name): # <-- tipo non definito ma injected
return name.getName()
def print_hi(name):
t2 = Test2()
print(f'Hi, {name}, {t2.getTestName("sale")} {t2.getTestName2()} ')
if __name__ == '__main__':
SnakeNest.initialize()
print_hi('PyCharm')
# SnakeNest.clear()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for snakenest-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f151eec479d9d6d1b48ba67ddd104ed5ad9fea5a27dc11773f3d7427f4767af |
|
MD5 | d089077e9ea636033a743b9e3fa01080 |
|
BLAKE2b-256 | 11b79ae09b95357fe5e6282ab4662fd9f5c446da1c1f3a65e5a9bd0c05021cee |