Load services as submodules
This commit is contained in:
parent
b2151c41bc
commit
e475dffc95
1
debian/control
vendored
1
debian/control
vendored
@ -11,3 +11,4 @@ Architecture: any
|
||||
Pre-Depends: dpkg, python3, ${misc:Pre-Depends}
|
||||
Depends: ${python:Depends}, ${misc:Depends}
|
||||
Description: configuration manager
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
from asyncio import get_event_loop
|
||||
from risotto import get_app
|
||||
|
9
setup.py
Normal file
9
setup.py
Normal file
@ -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
|
||||
|
||||
__ALL__ = ('get_app',)
|
||||
|
||||
__ALL__ = ('get_app', 'services')
|
||||
|
Loading…
Reference in New Issue
Block a user