Load services as submodules
This commit is contained in:
parent
b2151c41bc
commit
e475dffc95
|
@ -11,3 +11,4 @@ Architecture: any
|
||||||
Pre-Depends: dpkg, python3, ${misc:Pre-Depends}
|
Pre-Depends: dpkg, python3, ${misc:Pre-Depends}
|
||||||
Depends: ${python:Depends}, ${misc:Depends}
|
Depends: ${python:Depends}, ${misc:Depends}
|
||||||
Description: configuration manager
|
Description: configuration manager
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
from asyncio import get_event_loop
|
from asyncio import get_event_loop
|
||||||
from risotto import get_app
|
from risotto import get_app
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='risotto',
|
||||||
|
version='0.1',
|
||||||
|
packages=['risotto' ],
|
||||||
|
scripts=['script/risotto.py'],
|
||||||
|
package_dir={"": "src"},
|
||||||
|
)
|
|
@ -1,4 +1,13 @@
|
||||||
|
from pkg_resources import iter_entry_points
|
||||||
|
|
||||||
|
class Service:
|
||||||
|
pass
|
||||||
|
|
||||||
|
services = Service()
|
||||||
|
for ep in iter_entry_points(group='risotto_services'):
|
||||||
|
setattr(services, ep.name, ep.load())
|
||||||
|
|
||||||
|
def list_modules():
|
||||||
|
return services
|
||||||
from .http import get_app
|
from .http import get_app
|
||||||
|
__ALL__ = ('get_app', 'services')
|
||||||
__ALL__ = ('get_app',)
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue