Commit 98c84bd6 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Rename package kamaki.cli.commands --> cmds

parent 1040a59e
......@@ -4,7 +4,7 @@ Adding Commands
Kamaki commands are implemented as python classes, which wear a decorator
called *command*. The decorator lives in *kamaki.cli* and its purpose is to
update the *CommandTree* structure. The *CommandTree* class (
*kamaki.cli.commant_tree*) manages command namespaces for kamaki.
*kamaki.cli.cmdtree*) manages command namespaces for kamaki.
For demonstration purposes, the following set of kamaki commands will be
implemented in this document::
......@@ -96,7 +96,7 @@ application to load the list of commands from the *_commands* array.
The command decorator
---------------------
All commands are specified by subclasses of *kamaki.cli.commands._command_init*
All commands are specified by subclasses of *kamaki.cli.cmds._command_init*
These classes are called "command specifications".
The *command* decorator mines all the information needed to build namespaces
......@@ -336,7 +336,7 @@ Letting kamaki know
Assume that the command specifications presented so far be stored in a file
named *grps.py*.
The developer should move the file *grps.py* to *kamaki/cli/commands*, the
The developer should move the file *grps.py* to *kamaki/cli/cmds*, the
default place for command specifications
These lines should be contained in the kamaki configuration file for a new
......@@ -370,7 +370,7 @@ Summary: create a command set
# File: grps.py
from kamaki.cli.commands import _command_init
from kamaki.cli.cmds import _command_init
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.argument import ValueArgument, FlagArgument
...
......
......@@ -10,7 +10,7 @@ astakos
^^^^^^^
Features: user, project, quota, resource, commission, endpoint, service
.. automodule:: kamaki.cli.commands.astakos
.. automodule:: kamaki.cli.cmds.astakos
:members:
:undoc-members:
......@@ -19,7 +19,7 @@ cyclades
Features server, flavor
.. automodule:: kamaki.cli.commands.cyclades
.. automodule:: kamaki.cli.cmds.cyclades
:members:
:undoc-members:
......@@ -28,7 +28,7 @@ pithos
Features file, container, sharer, group
.. automodule:: kamaki.cli.commands.pithos
.. automodule:: kamaki.cli.cmds.pithos
:members:
:undoc-members:
......@@ -37,7 +37,7 @@ image
Features (image, imagecompute)
.. automodule:: kamaki.cli.commands.image
.. automodule:: kamaki.cli.cmds.image
:members:
:undoc-members:
......@@ -47,7 +47,7 @@ network
Features network, port, subnet, ip
.. automodule:: kamaki.cli.commands.network
.. automodule:: kamaki.cli.cmds.network
:members:
:undoc-members:
......@@ -57,7 +57,7 @@ Kamaki commands
config
""""""
.. automodule:: kamaki.cli.commands.config
.. automodule:: kamaki.cli.cmds.config
:members:
:undoc-members:
......@@ -65,7 +65,7 @@ config
errors
^^^^^^
.. automodule:: kamaki.cli.commands.errors
.. automodule:: kamaki.cli.cmds.errors
:members:
:show-inheritance:
:undoc-members:
......
......@@ -163,6 +163,8 @@ def command(cmd_tree, prefix='', descedants_depth=1):
cmd_spec_locations = [
'kamaki.cli.cmds',
'kamaki.cmds',
'kamaki.cli.commands',
'kamaki.commands',
'kamaki.cli',
......@@ -309,7 +311,7 @@ def init_cached_authenticator(config_argument, cloud, logger):
auth_base.authenticate(token)
else:
tmp_base = CachedAstakosClient(url, token)
from kamaki.cli.commands import _command_init
from kamaki.cli.cmds import _command_init
fake_cmd = _command_init(dict(config=config_argument))
fake_cmd.client = auth_base
fake_cmd._set_log_params()
......
......@@ -36,7 +36,7 @@ from os.path import abspath
from kamaki.cli import command
from kamaki.clients.astakos import LoggedAstakosClient
from kamaki.cli.commands import (
from kamaki.cli.cmds import (
_command_init, errors, _optional_json, addLogSettings, _name_filter)
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.errors import (
......
......@@ -33,7 +33,7 @@
from kamaki.cli import command
from kamaki.cli.argument import FlagArgument
from kamaki.cli.commands import _command_init, errors
from kamaki.cli.cmds import _command_init, errors
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.errors import CLIError, CLISyntaxError
......
......@@ -46,7 +46,7 @@ from kamaki.clients.cyclades import CycladesClient
from kamaki.cli.argument import (
FlagArgument, ValueArgument, KeyValueArgument, RepeatableArgument,
ProgressBarArgument, DateArgument, IntArgument, StatusArgument)
from kamaki.cli.commands import (
from kamaki.cli.cmds import (
_command_init, errors, addLogSettings, dataModification,
_optional_output_cmd, _optional_json, _name_filter, _id_filter)
......
......@@ -35,7 +35,7 @@ from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.argument import ValueArgument
from kamaki.cli.history import History
from kamaki.cli import command
from kamaki.cli.commands import _command_init, errors
from kamaki.cli.cmds import _command_init, errors
history_cmds = CommandTree('history', 'Kamaki command history')
......
# Copyright 2012-2013 GRNET S.A. All rights reserved.
# Copyright 2012-2014 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
......@@ -46,12 +46,11 @@ from kamaki.clients import ClientError
from kamaki.cli.argument import (
FlagArgument, ValueArgument, RepeatableArgument, KeyValueArgument,
IntArgument, ProgressBarArgument)
from kamaki.cli.commands.cyclades import _init_cyclades
from kamaki.cli.errors import (
CLIError, raiseCLIError, CLIBaseUrlError, CLIInvalidArgument)
from kamaki.cli.commands import _command_init, errors, addLogSettings
from kamaki.cli.commands import (
_optional_output_cmd, _optional_json, _name_filter, _id_filter)
from kamaki.cli.cmds.cyclades import _init_cyclades
from kamaki.cli.errors import CLIError, raiseCLIError, CLIInvalidArgument
from kamaki.cli.cmds import (
_command_init, errors, addLogSettings, _optional_output_cmd,
_optional_json, _name_filter, _id_filter)
image_cmds = CommandTree('image', 'Cyclades/Plankton API image commands')
......@@ -380,7 +379,7 @@ class PithosLocationArgument(ValueArgument):
@value.setter
def value(self, location):
if location:
from kamaki.cli.commands.pithos import _pithos_container as pc
from kamaki.cli.cmds.pithos import _pithos_container as pc
try:
uuid, self.container, self.path = pc._resolve_pithos_url(
location)
......
# Copyright 2011-2013 GRNET S.A. All rights reserved.
# Copyright 2011-2014 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
......@@ -43,10 +43,10 @@ from kamaki.clients.cyclades import (
from kamaki.cli.argument import (
FlagArgument, ValueArgument, RepeatableArgument, IntArgument,
StatusArgument)
from kamaki.cli.commands import _command_init, errors, addLogSettings
from kamaki.cli.commands import (
_optional_output_cmd, _optional_json, _name_filter, _id_filter)
from kamaki.cli.commands.cyclades import _service_wait
from kamaki.cli.cmds import (
_command_init, errors, addLogSettings, _optional_output_cmd,
_optional_json, _name_filter, _id_filter)
from kamaki.cli.cmds.cyclades import _service_wait
network_cmds = CommandTree('network', 'Network API network commands')
......
......@@ -40,7 +40,7 @@ from kamaki.clients.pithos import PithosClient, ClientError
from kamaki.cli import command
from kamaki.cli.cmdtree import CommandTree
from kamaki.cli.commands import (
from kamaki.cli.cmds import (
_command_init, errors, addLogSettings, DontRaiseKeyError, _optional_json,
_name_filter, _optional_output_cmd)
from kamaki.cli.errors import (
......
......@@ -65,7 +65,7 @@ setup(
'kamaki.cli.utils',
'kamaki.cli.config',
'kamaki.cli.argument',
'kamaki.cli.commands',
'kamaki.cli.cmds',
'kamaki.cli.cmdtree',
'kamaki.clients',
'kamaki.clients.utils',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment