Browse Source

ee site controller complete

bugfixes
harshadyeola 10 years ago
parent
commit
851c622d88
  1. 4
      ee/cli/bootstrap.py
  2. 53
      ee/cli/controllers/site.py

4
ee/cli/bootstrap.py

@ -6,6 +6,8 @@
from cement.core import handler
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
@ -13,6 +15,8 @@ from ee.cli.controllers.clean import EECleanController
def load(app):
handler.register(EEBaseController)
handler.register(EESiteController)
handler.register(EESiteCreateController)
handler.register(EESiteUpdateController)
handler.register(EEStackController)
handler.register(EEDebugController)
handler.register(EECleanController)

53
ee/cli/controllers/site.py

@ -11,12 +11,6 @@ class EESiteController(CementBaseController):
description = 'site command manages website configuration with the help of the following subcommands'
arguments = [
(['site_name'], dict(help='the notorious foo option') ),
(['--html'], dict(help="html site", action='store_true')),
(['--php'], dict(help="php site", action='store_true')),
(['--mysql'], dict(help="mysql site", action='store_true')),
(['--wp'], dict(help="wordpress site", action='store_true')),
(['--wpsubdir'], dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'], dict(help="wpsubdomain site", action='store_true')),
]
@expose(hide=True)
@ -24,11 +18,6 @@ class EESiteController(CementBaseController):
# TODO Default action for ee site command
print("Inside EESiteController.default().")
@expose(help="create site example.com")
def create(self):
# TODO Write code for ee site create command here
print("Inside EESiteController.create().")
@expose(help="delete site example.com")
def delete(self):
# TODO Write code for ee site delete command here
@ -74,10 +63,6 @@ class EESiteController(CementBaseController):
# TODO Write code for ee site cd here
print("Inside EESiteController.cd().")
@expose(help="update example.com")
def update(self):
# TODO Write code for ee site update here
print("Inside EESiteController.update().")
# site command Options and subcommand calls and definations to
# mention here
@ -92,3 +77,41 @@ class EESiteController(CementBaseController):
# The 'default.mustache' file would be loaded from
# ``ee.cli.templates``, or ``/var/lib/ee/templates/``.
#
class EESiteCreateController(CementBaseController):
class Meta:
label = 'create'
stacked_on = 'site'
stacked_type = 'nested'
description = 'create command manages website configuration with the help of the following subcommands'
arguments = [
(['--html'], dict(help="html site", action='store_true')),
(['--php'], dict(help="php site", action='store_true')),
(['--mysql'], dict(help="mysql site", action='store_true')),
(['--wp'], dict(help="wordpress site", action='store_true')),
(['--wpsubdir'], dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'], dict(help="wpsubdomain site", action='store_true')),
]
@expose(hide=True)
def default(self):
# TODO Default action for ee site command
print("Inside EESiteCreateController.default().")
class EESiteUpdateController(CementBaseController):
class Meta:
label = 'update'
stacked_on = 'site'
stacked_type = 'nested'
description = 'update command manages website configuration with the help of the following subcommands'
arguments = [
(['--html'], dict(help="html site", action='store_true')),
(['--php'], dict(help="php site", action='store_true')),
(['--mysql'], dict(help="mysql site", action='store_true')),
(['--wp'], dict(help="wordpress site", action='store_true')),
(['--wpsubdir'], dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'], dict(help="wpsubdomain site", action='store_true')),
]
@expose(help="update example.com")
def default(self):
# TODO Write code for ee site update here
print("Inside EESiteUpdateController.default().")

Loading…
Cancel
Save