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
def command_noop(args):
"""noop"""
pass
@requires("lexicon")
def command_create(args):
"""
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("--displayname", help="User's publicly displayed name")
@add_argument("--email", help="User's email")
def command_add(args):
"""Creates a user"""
def command_create(args):
"""
Create a user
"""
import json
import user
@ -34,6 +36,9 @@ def command_add(args):
@add_argument("--id", help="id of user to delete")
def command_delete(args):
"""
Delete a user
"""
import os
import config
@ -50,7 +55,7 @@ def command_delete(args):
@no_argument
def command_list(args):
"""Lists users"""
"""List all users"""
import os
import config
@ -65,9 +70,18 @@ def command_list(args):
for user in users:
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")
def command_passwd(args):
"""Set a user's password"""
"""
Set a user's password
"""
import getpass
import os