Skip to content

aioworkers/aioworkers-attrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aioworkers-attrs

mymodule.py:

from aioworkers_attrs import attr


@attr.entity
class A:
    c = attr.ib(type=int)

    @c.default
    def set_default_c(self):
        return self.config.get('c', 0)

    async def init(self):
        x = self.c
        # do something

conf.yaml:

a:
  cls: mymodule.A
  c: 1

run:

aioworkers -i -c conf.yaml

and type:

> from aioworkers_attrs import attr

> attr.asdict(context.a)

{'c': 1}

Releases

No releases published

Packages

No packages published

Languages