Apply formatter

This commit is contained in:
Griatch 2022-11-01 23:27:33 +01:00
parent 2bb8da38ee
commit 8f39c49aea
2 changed files with 12 additions and 8 deletions

View file

@ -150,11 +150,12 @@ Extra Installation Instructions:
"""
import re
from string import punctuation
from django.conf import settings
from evennia.objects.objects import DefaultObject, DefaultCharacter
from evennia.objects.models import ObjectDB
from evennia.commands.command import Command
from evennia.commands.cmdset import CmdSet
from evennia.commands.command import Command
from evennia.objects.models import ObjectDB
from evennia.objects.objects import DefaultCharacter, DefaultObject
from evennia.utils import ansi, logger
from evennia.utils.utils import lazy_property, make_iter, variable_from_module
@ -319,7 +320,9 @@ def parse_language(speaker, emote):
return emote, mapping
def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False, case_sensitive=True, fallback=None):
def parse_sdescs_and_recogs(
sender, candidates, string, search_mode=False, case_sensitive=True, fallback=None
):
"""
Read a raw emote and parse it into an intermediary
format for distributing to all observers.
@ -338,7 +341,8 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False, case_
a little more to learn for players. If disabled, the original sdesc case
is always kept and are inserted as-is.
fallback (string, optional): If set, any references that don't match a target
will be replaced with the fallback string.
will be replaced with the fallback string. If `None` (default), the
parsing will fail and give a warning about the missing reference.
Returns:
(emote, mapping) (tuple): If `search_mode` is `False`
@ -1131,7 +1135,7 @@ class CmdRecog(RPCommand): # assign personal alias to object in room
all_recogs = caller.recog.all()
if not all_recogs:
caller.msg(
"You recognize no-one. " "(Use 'recog <sdesc> as <alias>' to recognize people."
"You recognize no-one. (Use 'recog <sdesc> as <alias>' to recognize people."
)
else:
# note that we don't skip those failing enable_recog lock here,
@ -1141,7 +1145,7 @@ class CmdRecog(RPCommand): # assign personal alias to object in room
for key, obj in all_recogs.items()
)
caller.msg(
f"Currently recognized (use 'recog <sdesc> as <alias>' to add "
"Currently recognized (use 'recog <sdesc> as <alias>' to add "
f"new and 'forget <alias>' to remove):\n{lst}"
)
return

View file

@ -96,7 +96,7 @@ recog01 = "Mr Receiver"
recog02 = "Mr Receiver2"
recog10 = "Mr Sender"
emote = 'With a flair, /me looks at /first and /colliding sdesc-guy. She says "This is a test."'
fallback_emote = '/Me is distracted from /first by /nomatch.'
fallback_emote = "/Me is distracted from /first by /nomatch."
case_emote = "/Me looks at /first. Then, /me looks at /FIRST, /First and /Colliding twice."
poss_emote = "/Me frowns at /first for trying to steal /me's test."