Skip to content

Commit

Permalink
Remove unused imports and fix logging message
Browse files Browse the repository at this point in the history
  • Loading branch information
maxblan committed Mar 15, 2024
1 parent 9fbbf57 commit 4185e09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions python/socha/api/networking/game_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from socha.api.networking.utils import handle_move, if_last_game_state, if_not_last_game_state
from socha.api.networking.xml_protocol_interface import XMLProtocolInterface
from socha.api.protocol.protocol import State, Error, Join, Joined, JoinPrepared, JoinRoom, Room, Result, MoveRequest, \
Left, Errorpacket, Authenticate, Prepared, Slot, Prepare, Observe, Cancel, Observed, Step, Pause
Left, Authenticate, Prepared, Slot, Prepare, Observe, Cancel, Observed, Step, Pause
from socha.api.protocol.protocol_packet import ProtocolPacket


Expand Down Expand Up @@ -296,7 +296,7 @@ def _handle_left(self):
"The server left. Client tries to reconnect to the server.")
for _ in range(3):
logging.info(
f"Try to establish a connection with the server...")
"Try to establish a connection with the server...")
try:
self.connect()
if self.network_interface.connected:
Expand Down
4 changes: 2 additions & 2 deletions python/socha/api/networking/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from socha import _socha
from socha._socha import Field, FieldType, Move, TeamEnum, CubeCoordinates, GameState
from socha.api.protocol.protocol import Acceleration, Actions, Advance, Push, Ship, Turn, Board, Data, Water, Sandbank, Island, Passenger, Goal
from socha.api.protocol.protocol import Acceleration, Actions, Advance, Push, Turn, Board, Data, Water, Sandbank, Island, Passenger, Goal


def _convert_board(protocol_board: Board) -> _socha.Board:
Expand Down Expand Up @@ -128,7 +128,7 @@ def if_last_game_state(message, last_game_state) -> GameState:

last_move = Move(actions=new_actions)
return last_game_state.perform_move(last_move)
except Exception as e:
except Exception:
return if_not_last_game_state(message)


Expand Down
10 changes: 5 additions & 5 deletions python/socha/utils/package_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _download_dependencies(self):
except Exception as e:
logging.error(f"Error reading requirements file: {str(e)}")
logging.info(
f"Please create a 'requirements.txt' in the same folder as your logic.")
"Please create a 'requirements.txt' in the same folder as your logic.")
sys.exit(1)

logging.info(f'Downloading the following packages: {requirements}')
Expand Down Expand Up @@ -148,17 +148,17 @@ def _create_shell_script(self):
f.write('set -e\n')
f.write('\n')
f.write(
f'# Sets the environment variable, which specifies the location for pip to store its cache files\n')
'# Sets the environment variable, which specifies the location for pip to store its cache files\n')
f.write(
f'export XDG_CACHE_HOME=./{self.package_name}/.pip_cache\n')
f.write('\n')
f.write(
f'# Sets the environment variable, which adds the directory to the list of paths that Python searches '
f'for modules and packages when they are imported.\n')
'# Sets the environment variable, which adds the directory to the list of paths that Python searches '
'for modules and packages when they are imported.\n')
f.write(
f'export PYTHONPATH=./{self.package_name}/packages:$PYTHONPATH\n')
f.write('\n')
f.write(f'# Install the package socha and dependencies\n')
f.write('# Install the package socha and dependencies\n')
f.write(
f'pip install --no-index --find-links=./{self.package_name}/{self.dependencies_dir}/ --target=./'
f'{self.package_name}/{self.packages_dir}/ --cache-dir=./{self.package_name}/{self.cache_dir} ')
Expand Down

0 comments on commit 4185e09

Please sign in to comment.