Browse Source

Changed stack to work as plugin

bugfixes
gau1991 10 years ago
parent
commit
e4e7dfd932
  1. 2
      config/ee.conf
  2. 2
      config/plugins.d/example.conf
  3. 8
      config/plugins.d/stack.conf
  4. 3
      ee/cli/bootstrap.py
  5. 15
      ee/cli/plugins/stack.py

2
config/ee.conf

@ -37,5 +37,3 @@
### The maximun number of log files to maintain when rotating
# max_files = 4

2
config/plugins.d/example.conf

@ -5,7 +5,7 @@
### If enabled, load a plugin named `example` either from the Python module
### `ee.cli.plugins.example` or from the file path
### `/var/lib/ee/plugins/example.py`
enable_plugin = true
enable_plugin = false
### Additional plugin configuration settings
foo = bar

8
config/plugins.d/stack.conf

@ -0,0 +1,8 @@
### Example Plugin Configuration for EasyEngine
[stack]
### If enabled, load a plugin named `example` either from the Python module
### `ee.cli.plugins.example` or from the file path
### `/var/lib/ee/plugins/example.py`
enable_plugin = true

3
ee/cli/bootstrap.py

@ -8,19 +8,18 @@ from ee.cli.controllers.base import EEBaseController
from ee.cli.controllers.site import EESiteController
from ee.cli.controllers.site import EESiteCreateController
from ee.cli.controllers.site import EESiteUpdateController
from ee.cli.controllers.stack import EEStackController
from ee.cli.controllers.debug import EEDebugController
from ee.cli.controllers.clean import EECleanController
from ee.cli.controllers.secure import EESecureController
from ee.cli.controllers.isl import EEImportslowlogController
from ee.cli.controllers.info import EEInfoController
def load(app):
handler.register(EEBaseController)
handler.register(EESiteController)
handler.register(EESiteCreateController)
handler.register(EESiteUpdateController)
handler.register(EEStackController)
handler.register(EEDebugController)
handler.register(EECleanController)
handler.register(EEInfoController)

15
ee/cli/controllers/stack.py → ee/cli/plugins/stack.py

@ -1,6 +1,11 @@
"""EasyEngine site controller."""
"""Example Plugin for EasyEngine."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
def ee_stack_hook(app):
# do something with the ``app`` object here.
pass
class EEStackController(CementBaseController):
@ -36,3 +41,11 @@ class EEStackController(CementBaseController):
# The 'default.mustache' file would be loaded from
# ``ee.cli.templates``, or ``/var/lib/ee/templates/``.
#
def load(app):
# register the plugin class.. this only happens if the plugin is enabled
handler.register(EEStackController)
# register a hook (function) to run after arguments are parsed.
hook.register('post_argument_parsing', ee_stack_hook)
Loading…
Cancel
Save