Commit fd72bf6e authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Adapt for new version of kamaki command().

parents bd505644 04b23e44
......@@ -2,6 +2,7 @@
from kamaki.cli.commands import _command_init
from kamaki.cli import command
from kamaki.cli.command_tree import CommandTree
from kamaki.cli.errors import CLIError
class cli_generator(object):
......@@ -10,15 +11,18 @@ class cli_generator(object):
appname = None
plugin = None
add_context = False
ctree = None
description = None
def __init__(self):
self.api_spec = self.plugin.api_spec
self.appname = self.plugin.appname
self.ctree = CommandTree(self.appname, self.description)
def generate_all(self):
for f in self.api_spec.call_names():
c = self.mkClass(f)
command()(c)
command(self.ctree)(c)
def mkClass(self, method):
class C(_command_init):
......
......@@ -7,4 +7,5 @@ class quotaholder_cli(cli_generator):
def __init__(self):
self.plugin = quotaholder_plugin
self.add_context = True
self.description = 'Quotaholder description'
super(self.__class__, self).__init__()
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