Skip to content

Commit

Permalink
log: Log file IO results
Browse files Browse the repository at this point in the history
  • Loading branch information
xlxs4 committed Dec 16, 2022
1 parent a1a15af commit f85bcb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GUI.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import deque
from copy import deepcopy
import logging
from pathlib import Path

from PySide6.QtCore import QSize, Slot
Expand Down Expand Up @@ -273,6 +274,8 @@ def _browse_gcode(self) -> None:

self._update_gcode_viewer()

logging.info(f"Loaded file {gcode_filename.name} successfully.")

def _save_gcode(self) -> None:
dialog = QFileDialog(self)
dialog.setFileMode(QFileDialog.AnyFile)
Expand All @@ -285,6 +288,8 @@ def _save_gcode(self) -> None:
gcode_filename = dialog.selectedFiles()[0]
write_gcode(gcode_filename, self.gcode)

logging.info(f"Saved file {gcode_filename.name} successfully.")

def _update_gcode_viewer(self) -> None:
if self.gcode is not None:
self.gcode_viewer.setPlainText(lines_to_text(self.gcode))
Expand Down

0 comments on commit f85bcb9

Please sign in to comment.