Skip to content

Commit

Permalink
see below
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Dec 6, 2023
1 parent bd6ba58 commit 2e02ac2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sizebot/cogs/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async def food(self, ctx, food: typing.Union[DigiObject, str], *, who: typing.Un
food_per_day = 1 / days_per_food

if food_per_day >= 1:
foodout = f"{userdata.nickname} would need to eat **{food_per_day:,.1} {food.namePlural}** per day.\n(1 {food.name} is {food.calories} calories.)"
foodout = f"{userdata.nickname} would need to eat **{food_per_day:,.1} {food.name_plural}** per day.\n(1 {food.name} is {food.calories} calories.)"
else:
foodout = f"A {food.name} ({food.calories} calories) would last {userdata.nickname} **{prettyTimeDelta(86400 * days_per_food, roundeventually=True)}.**"

Expand Down
10 changes: 5 additions & 5 deletions sizebot/lib/objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def __init__(self, name, dimension, aliases=[], tags=[], symbol = None, height =

self.name = name
self.dimension = dimension
self.namePlural = get_plural(name)
self.singularNames = aliases + [self.name]
self.name_plural = get_plural(name)
self.singular_names = aliases + [self.name]
self.aliases = aliases + [get_plural(a) for a in aliases]
self.aliases = self.aliases + [a.replace("™", "").replace("®", "") for a in self.aliases + [self.name]] # Remove ®, ™
self.aliases = list(set(self.aliases)) # Remove duplicates
Expand Down Expand Up @@ -68,12 +68,12 @@ def image(self):

def add_to_units(self):
if self.unitlength is not None:
SV.addUnit(Unit(factor=self.unitlength, name=self.name, namePlural=self.namePlural,
SV.addUnit(Unit(factor=self.unitlength, name=self.name, namePlural=self.name_plural,
names=self.aliases, symbol = self.symbol))
SV.addSystemUnit("o", SystemUnit(self.name))

if self.weight is not None:
WV.addUnit(Unit(factor=self.weight, name=self.name, namePlural=self.namePlural,
WV.addUnit(Unit(factor=self.weight, name=self.name, namePlural=self.name_plural,
names=self.aliases, symbol = self.symbol))
WV.addSystemUnit("o", SystemUnit(self.name))

Expand Down Expand Up @@ -185,7 +185,7 @@ def __eq__(self, other):
if isinstance(other, str):
lowerName = other.lower()
return lowerName == self.name.lower() \
or lowerName == self.namePlural \
or lowerName == self.name_plural \
or lowerName in (n.lower() for n in self.aliases)
elif isinstance(other, DigiObject):
return (self.name, self.unitlength) == (other.name, other.unitlength)
Expand Down

0 comments on commit 2e02ac2

Please sign in to comment.