Skip to content

Commit

Permalink
Update to match rc0
Browse files Browse the repository at this point in the history
  • Loading branch information
Moosems committed Sep 7, 2024
1 parent db662e3 commit b55ec9e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions salve/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,14 @@ def request( # type: ignore
definition_starters: list[tuple[str, str]] = [("", "before")],
) -> None:
"""Sends the main_server a request of type command with given kwargs - external API"""
self.logger.debug("Beginning request")
if command not in COMMANDS:
self.logger.exception(
f"Command {command} not in builtin commands. Those are {COMMANDS}!"
)
raise Exception(
f"Command {command} not in builtin commands. Those are {COMMANDS}!"
)

if file not in self.files and command != EDITORCONFIG:
self.logger.exception(f"File {file} does not exist in system!")
raise Exception(f"File {file} does not exist in system!")

self.logger.debug("Sending info to create_message()")
request: dict = {
"command": command,
"expected_keywords": expected_keywords,
Expand All @@ -80,6 +74,8 @@ def request( # type: ignore
"file_path": file_path,
"definition_starters": definition_starters,
}

if file:
request.update({"file": file})
super().request(request)
request["file"] = file

super().request(**request)

0 comments on commit b55ec9e

Please sign in to comment.