Add stubs for initial command set

This commit is contained in:
Tim Van Baak 2020-01-15 22:06:30 -08:00
parent 7b6e9e644e
commit 594e6f6a9e
2 changed files with 125 additions and 8 deletions

View File

@ -1,6 +1,109 @@
from cli.helpers import add_argument, no_argument from cli.helpers import add_argument, no_argument, requires
#
# CRUD commands
#
@no_argument @no_argument
def command_noop(args): @requires("lexicon")
"""noop""" def command_create(args):
pass """
Create a lexicon
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_delete(args):
"""
Delete a lexicon and all its data
"""
raise NotImplementedError()
@no_argument
def command_list(args):
"""
List all lexicons and their statuses
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_config(args):
"""
Interact with a lexicon's config
"""
raise NotImplementedError()
#
# Player/character commands
#
@no_argument
@requires("lexicon")
def command_player_add(args):
"""
Add a player to a lexicon
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_player_remove(args):
"""
Remove a player from a lexicon
Removing a player dissociates them from any characters
they control but does not delete any character data.
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_player_list(args):
"""
List all players in a lexicon
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_char_create(args):
"""
Create a character for a lexicon
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_char_delete(args):
"""
Delete a character from a lexicon
Deleting a character dissociates them from any content
they have contributed rather than deleting it.
"""
raise NotImplementedError()
@no_argument
@requires("lexicon")
def command_char_list(args):
"""
List all characters in a lexicon
"""
raise NotImplementedError()
#
# Procedural commands
#
@no_argument
@requires("lexicon")
def command_publish_turn(args):
"""
Publishes the current turn of a lexicon
Ability to publish is checked against the lexicon's
turn publish policy unless --force is specified.
"""
raise NotImplementedError()

View File

@ -3,8 +3,10 @@ from cli.helpers import add_argument, no_argument
@add_argument("--username", help="User's login handle") @add_argument("--username", help="User's login handle")
@add_argument("--displayname", help="User's publicly displayed name") @add_argument("--displayname", help="User's publicly displayed name")
@add_argument("--email", help="User's email") @add_argument("--email", help="User's email")
def command_add(args): def command_create(args):
"""Creates a user""" """
Create a user
"""
import json import json
import user import user
@ -34,6 +36,9 @@ def command_add(args):
@add_argument("--id", help="id of user to delete") @add_argument("--id", help="id of user to delete")
def command_delete(args): def command_delete(args):
"""
Delete a user
"""
import os import os
import config import config
@ -50,7 +55,7 @@ def command_delete(args):
@no_argument @no_argument
def command_list(args): def command_list(args):
"""Lists users""" """List all users"""
import os import os
import config import config
@ -65,9 +70,18 @@ def command_list(args):
for user in users: for user in users:
print("{0} {1} ({2})".format(user['uid'], user['displayname'], user['username'])) print("{0} {1} ({2})".format(user['uid'], user['displayname'], user['username']))
@no_argument
def command_config(args):
"""
Interact with a user's config
"""
raise NotImplementedError()
@add_argument("--username", help="The user to change password for") @add_argument("--username", help="The user to change password for")
def command_passwd(args): def command_passwd(args):
"""Set a user's password""" """
Set a user's password
"""
import getpass import getpass
import os import os