Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nonprofittechy committed Aug 15, 2024
1 parent 18fec57 commit a001b19
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions docassemble/AssemblyLine/al_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def pronoun_reflexive(self, **kwargs) -> str:
**kwargs: Additional keyword arguments that are defined [upstream](https://docassemble.org/docs/objects.html#language%20methods).
- person (Optional[[Union[str,int]]): Whether to use a first, second, or third person pronoun. Can be one of 1/"1p", 2/"2p", or 3/"3p" (default is 3). See [upstream](https://docassemble.org/docs/objects.html#language%20methods) documentation for more information.
- default (Optional[str]): The default word to use if the pronoun is not defined, e.g. "the agent". If not defined, the default term is the user's name.
Returns:
str: The reflexive pronoun for the list.
"""
Expand All @@ -829,15 +829,17 @@ def pronoun_reflexive(self, **kwargs) -> str:
output = word("yourselves")
else:
output = word("themselves")

elif self.number_gathered() == 1:
if isinstance(self[0], ALIndividual) and hasattr(self[0], "pronoun_reflexive"):
if isinstance(self[0], ALIndividual) and hasattr(
self[0], "pronoun_reflexive"
):
output = self[0].pronoun_reflexive(**kwargs)
else:
output = word("itself")
else:
output = word("themselves")

if kwargs.get("capitalize"):
return output.capitalize()
return output
Expand Down Expand Up @@ -1895,7 +1897,7 @@ def pronoun_reflexive(self, **kwargs) -> str:
return word("yourself")
if person == "2p":
return word("yourselves")

if self == this_thread.global_vars.user:
output = word("yourself", **kwargs)

Expand All @@ -1920,27 +1922,30 @@ def pronoun_reflexive(self, **kwargs) -> str:
if isinstance(pronouns, DADict):
for pronoun in pronouns.true_values():
if pronoun in [
"she/her/hers",
"he/him/his",
"they/them/theirs",
"ze/zir/zirs",
]:
if pronoun == "she/her/hers":
pronouns_to_use.append(word("herself", **kwargs))
elif pronoun == "he/him/his":
pronouns_to_use.append(word("himself", **kwargs))
elif pronoun == "they/them/theirs":
pronouns_to_use.append(word("themself", **kwargs))
elif pronoun == "ze/zir/zirs":
pronouns_to_use.append(word("zirself", **kwargs))
"she/her/hers",
"he/him/his",
"they/them/theirs",
"ze/zir/zirs",
]:
if pronoun == "she/her/hers":
pronouns_to_use.append(word("herself", **kwargs))
elif pronoun == "he/him/his":
pronouns_to_use.append(word("himself", **kwargs))
elif pronoun == "they/them/theirs":
pronouns_to_use.append(word("themself", **kwargs))
elif pronoun == "ze/zir/zirs":
pronouns_to_use.append(word("zirself", **kwargs))
elif pronoun == "self-described" and has_parsable_pronouns(
self.pronouns_self_described
):
pronouns_to_use.append(
parse_custom_pronouns(self.pronouns_self_described)["o"] + word("self")
parse_custom_pronouns(self.pronouns_self_described)["o"]
+ word("self")
)
elif has_parsable_pronouns(pronoun):
pronouns_to_use.append(parse_custom_pronouns(pronoun)["o"] + word("self"))
pronouns_to_use.append(
parse_custom_pronouns(pronoun)["o"] + word("self")
)
if len(pronouns_to_use) > 0:
output = "/".join(pronouns_to_use)
else:
Expand All @@ -1961,13 +1966,14 @@ def pronoun_reflexive(self, **kwargs) -> str:
if default:
output = default
else:
output = word("themself") # reflexive pronoun shouldn't be the person's name
output = word(
"themself"
) # reflexive pronoun shouldn't be the person's name

if kwargs.get("capitalize"):
return capitalize(output)
return output


def name_full(self) -> str:
"""Returns the individual's full name.
Expand Down

0 comments on commit a001b19

Please sign in to comment.