|
|
@ -1,7 +1,11 @@ |
|
|
|
"""EasyEngine site controller.""" |
|
|
|
|
|
|
|
from cement.core.controller import CementBaseController, expose |
|
|
|
from ee.core.dummy import EEDummy |
|
|
|
from cement.core import handler, hook |
|
|
|
|
|
|
|
|
|
|
|
def ee_site_hook(app): |
|
|
|
# do something with the ``app`` object here. |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
class EESiteController(CementBaseController): |
|
|
@ -9,8 +13,8 @@ class EESiteController(CementBaseController): |
|
|
|
label = 'site' |
|
|
|
stacked_on = 'base' |
|
|
|
stacked_type = 'nested' |
|
|
|
description = 'site command manages website configuration with the help \ |
|
|
|
of the following subcommands' |
|
|
|
description = ('site command manages website configuration' |
|
|
|
'with the help of the following subcommands') |
|
|
|
arguments = [ |
|
|
|
(['site_name'], |
|
|
|
dict(help='website name')), |
|
|
@ -142,3 +146,13 @@ class EESiteUpdateController(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(EESiteController) |
|
|
|
handler.register(EESiteCreateController) |
|
|
|
handler.register(EESiteUpdateController) |
|
|
|
|
|
|
|
# register a hook (function) to run after arguments are parsed. |
|
|
|
hook.register('post_argument_parsing', ee_site_hook) |