Commit a4f34a02 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Georgios D. Tsoukalas

Improve project command help messages

parent e8d067b8
......@@ -41,7 +41,22 @@ from astakos.im.project_xctx import cmd_project_transaction_context
class Command(BaseCommand):
args = "<project application id>"
help = "Approve project application"
help = """
Approve a pending project application
You can discover projects with a pending application with
(the last column <AppID> is the application to be approved):
snf-manage project-list --pending
You can examine a specific application with:
snf-manage project-show --app <AppId>
For a given project, you can examine a pending application with:
snf-manage project-show <project> --pending
"""
def handle(self, *args, **options):
if len(args) < 1:
......
......@@ -42,7 +42,22 @@ from astakos.im.functions import deny_application
class Command(BaseCommand):
args = "<project application id>"
help = "Deny a project application"
help = """
Deny a project application
You can discover projects with a pending application with
(the last column <AppID> is the application to be denied):
snf-manage project-list --pending
You can examine a specific application with:
snf-manage project-show --app <AppId>
For a given project, you can examine a pending application with:
snf-manage project-show <project> --pending
"""
@transaction.commit_on_success
def handle(self, *args, **options):
......
......@@ -40,7 +40,34 @@ from ._common import format, shortened
class Command(NoArgsCommand):
help = "List projects and project status"
help = """
List projects and project status.
Project status can be one of:
Pending an application <AppId> for a new project
Active an active project
Active - Pending an active project with
a pending modification <AppId>
Denied an application for a new project,
denied by the admin
Dismissed a denied project, dismissed by the applicant
Cancelled an application for a new project,
cancelled by the applicant
Suspended a project suspended by the admin;
it can later be resumed
Suspended - Pending a suspended project with
a pending modification <AppId>
Terminated a terminated project; its name can be claimed
by a new project
"""
option_list = NoArgsCommand.option_list + (
make_option('-c',
......@@ -58,6 +85,11 @@ class Command(NoArgsCommand):
dest='full',
default=False,
help="Do not shorten long names"),
make_option('--pending',
action='store_true',
dest='pending',
default=False,
help="Show only projects with a pending application"),
)
def handle_noargs(self, **options):
......@@ -74,6 +106,9 @@ class Command(NoArgsCommand):
if options['skip']:
chain_dict = do_skip(chain_dict)
if options['pending']:
chain_dict = pending_only(chain_dict)
allow_shorten = not options['full']
for info in chain_info(chain_dict):
......@@ -103,6 +138,13 @@ class Command(NoArgsCommand):
self.stdout.write(line + '\n')
def pending_only(chain_dict):
d = {}
for chain, (state, project, app) in chain_dict.iteritems():
if state in Chain.PENDING_STATES:
d[chain] = (state, project, app)
return d
def do_skip(chain_dict):
d = {}
for chain, (state, project, app) in chain_dict.iteritems():
......
......@@ -42,20 +42,31 @@ from ._common import format
class Command(BaseCommand):
args = "<id or name>"
help = "Show project details"
help = """
Show project details.
Command comes in two forms:
project-show <id> Look up project by id
project-show <name> Look up all projects whose name
contains the given string
"""
option_list = BaseCommand.option_list + (
make_option('--app',
action='store_true',
dest='app',
default=False,
help="Show application details instead"),
help="Show details of applications instead of projects"
),
make_option('--pending',
action='store_true',
dest='pending',
default=False,
help="Show pending modification too"),
)
help=("For a given project, show also pending modifications "
"(applications), if any")
),
)
def handle(self, *args, **options):
if len(args) != 1:
......
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