Skip to content

Commit 027e62f

Browse files
committed
only print in debug mode
1 parent 3f8ea8c commit 027e62f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎language_tool_python/server.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def _register_spellings(self, spellings):
152152
spelling_file_path = self._get_valid_spelling_file_path()
153153
with open(spelling_file_path, "a+") as spellings_file:
154154
spellings_file.write("\n" + "\n".join([word for word in spellings]))
155-
print("Registered new spellings at {}".format(spelling_file_path))
155+
if DEBUG_MODE:
156+
print("Registered new spellings at {}".format(spelling_file_path))
156157

157158
def _unregister_spellings(self):
158159
spelling_file_path = self._get_valid_spelling_file_path()
@@ -164,7 +165,8 @@ def _unregister_spellings(self):
164165
spellings_file.seek(spellings_file.tell() - 2, os.SEEK_SET)
165166
spellings_file.seek(spellings_file.tell() + 1, os.SEEK_SET)
166167
spellings_file.truncate()
167-
print("Unregistered new spellings at {}".format(spelling_file_path))
168+
if DEBUG_MODE:
169+
print("Unregistered new spellings at {}".format(spelling_file_path))
168170

169171
def _get_languages(self) -> set:
170172
"""Get supported languages (by querying the server)."""

0 commit comments

Comments
 (0)