Add package importing, examples to README

This commit is contained in:
Gavin M. Roy 2015-06-12 16:35:01 -04:00
parent df926bab64
commit 37a0551ca2
2 changed files with 16 additions and 1 deletions

View File

@ -82,6 +82,21 @@ Plugin API Summary:
plugin.on_start(controller_module) # optional
plugin.on_shutdown(controller_module) # optional
Example Entrypoints
-------------------
Controller:
```python
{'sprockets.controller': ['http=sprockets.controllers.http:None']},
```
Application:
```python
{'sprockets.http.app': ['name=package.or.module:None']}
```
Applications
------------

View File

@ -292,7 +292,7 @@ class CLI(object):
"""
for pkg in self._get_applications(controller):
if pkg.name == application:
return pkg.module_name
return importlib.import_module(pkg.module_name)
return importlib.import_module(application)
@staticmethod