Skip to content

Commit

Permalink
Try to fix unused imports reported by Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gatsik committed Sep 22, 2021
1 parent 9648149 commit d2a9317
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion server/broadcast_service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import TYPE_CHECKING

from aio_pika import DeliveryMode
Expand All @@ -23,7 +25,7 @@ class BroadcastService(Service):

def __init__(
self,
server: "ServerInstance",
server: ServerInstance,
message_queue_service: MessageQueueService,
game_service: GameService,
player_service: PlayerService,
Expand Down
10 changes: 6 additions & 4 deletions server/games/game.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import json
import logging
Expand Down Expand Up @@ -72,9 +74,9 @@ class Game():
def __init__(
self,
id_: int,
database: "FAFDatabase",
game_service: "GameService",
game_stats_service: "GameStatsService",
database: FAFDatabase,
game_service: GameService,
game_stats_service: GameStatsService,
host: Optional[Player] = None,
name: str = "None",
map_: str = "SCMP_007",
Expand Down Expand Up @@ -206,7 +208,7 @@ def _is_observer(self, player: Player) -> bool:
return army is None or army < 0

@property
def connections(self) -> Iterable["GameConnection"]:
def connections(self) -> Iterable[GameConnection]:
return self._connections.values()

@property
Expand Down
3 changes: 2 additions & 1 deletion server/ladder_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Manages interactions between players and matchmakers
"""
from __future__ import annotations

import asyncio
import json
Expand Down Expand Up @@ -520,7 +521,7 @@ async def get_game_history(
])
return result

def on_connection_lost(self, conn: "LobbyConnection") -> None:
def on_connection_lost(self, conn: LobbyConnection) -> None:
if not conn.player:
return

Expand Down
4 changes: 3 additions & 1 deletion server/matchmaker/pop_timer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
from collections import deque
from time import time
Expand Down Expand Up @@ -29,7 +31,7 @@ class PopTimer(object):
The exact size can be set in config.
"""

def __init__(self, queue: "MatchmakerQueue"):
def __init__(self, queue: MatchmakerQueue):
self.queue = queue
# Set up deque's for calculating a moving average
self.last_queue_amounts: Deque[int] = deque(maxlen=config.QUEUE_POP_TIME_MOVING_AVG_SIZE)
Expand Down
3 changes: 2 additions & 1 deletion server/party_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Manages interactions between players and parties
"""
from __future__ import annotations

from typing import TYPE_CHECKING, Dict, List, Set

Expand Down Expand Up @@ -189,7 +190,7 @@ def remove_party(self, party):
# TODO: Send a special "disbanded" command?
self.write_broadcast_party(party, members=members)

def on_connection_lost(self, conn: "LobbyConnection") -> None:
def on_connection_lost(self, conn: LobbyConnection) -> None:
if not conn.player or conn.player not in self.player_parties:
return

Expand Down
3 changes: 2 additions & 1 deletion server/players.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Player type definitions
"""
from __future__ import annotations

from collections import defaultdict
from contextlib import suppress
Expand Down Expand Up @@ -47,7 +48,7 @@ def __init__(
ratings=None,
clan=None,
game_count=None,
lobby_connection: Optional["LobbyConnection"] = None
lobby_connection: Optional[LobbyConnection] = None
) -> None:
self._faction = Faction.uef

Expand Down

0 comments on commit d2a9317

Please sign in to comment.