Unworking commit for stashing
This commit is contained in:
parent
2a135f16da
commit
dc7cd2e69a
2 changed files with 17 additions and 16 deletions
|
|
@ -1185,32 +1185,34 @@ def list_node(option_generator, select=None, examine=None, edit=None, add=None,
|
||||||
which processors are available.
|
which processors are available.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
mode, selection, new_value = None, None, None
|
||||||
available_choices = kwargs.get("available_choices", [])
|
available_choices = kwargs.get("available_choices", [])
|
||||||
match = re.search(r"(^[a-zA-Z]*)\s*(.*?)$", raw_string)
|
|
||||||
cmd, args = match.groups()
|
|
||||||
mode, selection = None, None
|
|
||||||
cmd = cmd.lower().strip()
|
|
||||||
|
|
||||||
if args:
|
cmd, args = re.search(r"(^[a-zA-Z]*)\s*(.*?)$", raw_string).groups()
|
||||||
|
|
||||||
|
cmd = cmd.lower().strip()
|
||||||
|
if cmd.startswith('a') and add:
|
||||||
|
mode = "add"
|
||||||
|
new_value = args
|
||||||
|
else:
|
||||||
|
selection, new_value = re.search(r"(^[0-9]*)\s*(.*?)$", args).groups()
|
||||||
try:
|
try:
|
||||||
number = int(args) - 1
|
selection = int(selection) - 1
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if cmd.startswith("a") and add:
|
caller.msg("|rInvalid input|n")
|
||||||
mode = "add"
|
|
||||||
selection = args
|
|
||||||
else:
|
else:
|
||||||
|
# edits are on the form 'edit <num> <args>
|
||||||
if cmd.startswith("e") and edit:
|
if cmd.startswith("e") and edit:
|
||||||
mode = "edit"
|
mode = "edit"
|
||||||
elif examine:
|
elif examine:
|
||||||
mode = "look"
|
mode = "look"
|
||||||
try:
|
try:
|
||||||
selection = available_choices[number]
|
selection = available_choices[selection]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
caller.msg("|rInvalid index")
|
caller.msg("|rInvalid index|n")
|
||||||
mode = None
|
mode = None
|
||||||
|
|
||||||
return mode, selection
|
return mode, selection, new_value
|
||||||
|
|
||||||
def _relay_to_edit_or_add(caller, raw_string, **kwargs):
|
def _relay_to_edit_or_add(caller, raw_string, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
@ -1239,8 +1241,8 @@ def list_node(option_generator, select=None, examine=None, edit=None, add=None,
|
||||||
|
|
||||||
if mode == "arbitrary":
|
if mode == "arbitrary":
|
||||||
# freeform input, we must parse it for the allowed commands (look/edit)
|
# freeform input, we must parse it for the allowed commands (look/edit)
|
||||||
mode, selection = _input_parser(caller, raw_string,
|
mode, selection, new_value = _input_parser(caller, raw_string,
|
||||||
**{"available_choices": page})
|
**{"available_choices": page})
|
||||||
|
|
||||||
if examine and mode == "look":
|
if examine and mode == "look":
|
||||||
# look mode - we are examining a given entry
|
# look mode - we are examining a given entry
|
||||||
|
|
|
||||||
|
|
@ -1219,7 +1219,6 @@ def node_meta_desc(caller):
|
||||||
return text, options
|
return text, options
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def node_meta_tags(caller):
|
def node_meta_tags(caller):
|
||||||
metaprot = _get_menu_metaprot(caller)
|
metaprot = _get_menu_metaprot(caller)
|
||||||
text = ["|wMeta-Tags|n can be used to classify and find prototypes. Tags are case-insensitive. "
|
text = ["|wMeta-Tags|n can be used to classify and find prototypes. Tags are case-insensitive. "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue