Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gehock committed Sep 23, 2021
1 parent 83c9f7c commit 8fb305e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion commandListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ async def shutdown(self, ctx: Context):
# TODO: Test commands
@Cog.listener()
async def on_command_error(self, ctx: Context, error):
# pylint: disable=no-self-use
# pylint: disable=no-self-use, no-else-return
if isinstance(error, MissingRequiredArgument):
await ctx.send(f"Missing argument. See: `{CMD}help {ctx.command}`")
return
Expand Down
21 changes: 11 additions & 10 deletions event.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def additional_role_count(self) -> int:
return len(self.roleGroups["Additional"])

def changeSize(self, new_size):
# pylint: disable=too-many-statements
if new_size == self.platoon_size:
return None

Expand Down Expand Up @@ -344,7 +345,7 @@ def addAdditionalRole(self, name: str) -> str:
emoji = cfg.ADDITIONAL_ROLE_EMOJIS[self.additional_role_count]

# Create role
newRole = Role(name, emoji, True)
newRole = Role(name, emoji, show_name=True)

# Add role to additional roles
self.roleGroups["Additional"].addRole(newRole)
Expand Down Expand Up @@ -555,21 +556,21 @@ def toJson(self, brief_output=False) -> Dict[str, Any]:
data["roleGroups"] = roleGroupsData
return data

def fromJson(self, eventID, data, emojis, manual_load=False):
def fromJson(self, eventID, data: dict, emojis, manual_load=False):
self.id = int(eventID)
self.setTitle(data.get("title", TITLE))
time = datetime.datetime.strptime(data.get("time", "00:00"), "%H:%M")
self.setTime(time)
self.setTerrain(data.get("terrain", TERRAIN))
self.faction = data.get("faction", FACTION)
self.port = data.get("port", cfg.PORT_DEFAULT)
self.description = data.get("description", DESCRIPTION)
self.mods = data.get("mods", MODS)
self.faction = str(data.get("faction", FACTION))
self.port = int(data.get("port", cfg.PORT_DEFAULT))
self.description = str(data.get("description", DESCRIPTION))
self.mods = str(data.get("mods", MODS))
if not manual_load:
self.color = data.get("color", COLOR)
self.messageIDList = data.get("messageIDList", 0)
self.platoon_size = data.get("platoon_size", PLATOON_SIZE)
self.sideop = data.get("sideop", False)
self.color = int(data.get("color", COLOR))
self.messageIDList = list(data.get("messageIDList", [0]))
self.platoon_size = str(data.get("platoon_size", PLATOON_SIZE))
self.sideop = bool(data.get("sideop", False))
# TODO: Handle missing roleGroups
groups: List[str] = []
for groupName, roleGroupData in data["roleGroups"].items():
Expand Down

0 comments on commit 8fb305e

Please sign in to comment.