Add support for article=True and format=fmt to $You(r) and $you(r) #3511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
This adds two kwargs to the funcparser functions
$You()
/$you()
and$Your()
/$your()
.article=True
This will use
get_numbered_name
instead ofget_display_name
to return, for example, "a mouse" rather than "mouse".format=upper|lower|capital|title
This enforces specific casing of the output. Note that this overrides the current behaviour of only capitalising "You/Your", making the upper- and lower-case variations of the functions interchangeable. If no format is specified then the current behaviour is used, with the separate functions working independently.
Motivation for adding to Evennia
More options for the output of
$You()
, etc.Examples
Before:
Using:
After:
Using capitalisation formatting. This forces the first noun to always be capitalised, even if it is not "you".:
Including a request for the indefinite article:
Without any of the new formatting kwargs:
Output is the same as the current behaviour:
An example using
$your()
: