aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2025-08-15 18:21:41 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2025-08-15 21:46:37 +0100
commitf2d0c76fd98e850fddf0c2fb47ed9dce3fe64274 (patch)
tree22bdaaa2190f0880f6794719d79ea507976a522b
parentadcf25e7ba68d13f0ce3420d24fc91840b30e893 (diff)
downloadkutter-f2d0c76fd98e850fddf0c2fb47ed9dce3fe64274.tar.gz
kutter-f2d0c76fd98e850fddf0c2fb47ed9dce3fe64274.tar.xz
kutter-f2d0c76fd98e850fddf0c2fb47ed9dce3fe64274.zip
Drop support for printing MCU information
-rw-r--r--CHANGELOG.md1
-rw-r--r--klippy/klippy.py2
-rw-r--r--klippy/util.py49
3 files changed, 2 insertions, 50 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4511186a..3bf0e038 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,7 @@ Most changes are breaking.
* The version is now stored in `klippy/klippy.py` in `__version__` and is no
longer automatically retrieved from git or from `klippy/.version`.
* The version numbering has changed and versions are not compatible.
+* Drop support for printing most recent built MCU firmware details.
### Removed
diff --git a/klippy/klippy.py b/klippy/klippy.py
index 093b6619..4b444e48 100644
--- a/klippy/klippy.py
+++ b/klippy/klippy.py
@@ -157,14 +157,12 @@ class Printer:
logging.exception(msg)
self._set_state(msg)
self.send_event("klippy:notify_mcu_error", msg, {"error": str(e)})
- util.dump_mcu_build()
return
except mcu.error as e:
msg = "MCU error during connect"
logging.exception(msg)
self._set_state(msg)
self.send_event("klippy:notify_mcu_error", msg, {"error": str(e)})
- util.dump_mcu_build()
return
except Exception as e:
logging.exception("Unhandled exception during connect")
diff --git a/klippy/util.py b/klippy/util.py
index 8ad8ccaa..687c1435 100644
--- a/klippy/util.py
+++ b/klippy/util.py
@@ -3,7 +3,7 @@
# Copyright (C) 2016-2020 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import os, pty, fcntl, termios, signal, logging, json, time
+import os, pty, fcntl, termios, signal, logging
import traceback
@@ -53,53 +53,6 @@ def create_pty(ptyname):
######################################################################
-# Helper code for extracting mcu build info
-######################################################################
-
-
-def dump_file_stats(build_dir, filename):
- fname = os.path.join(build_dir, filename)
- try:
- mtime = os.path.getmtime(fname)
- fsize = os.path.getsize(fname)
- timestr = time.asctime(time.localtime(mtime))
- logging.info("Build file %s(%d): %s", fname, fsize, timestr)
- except:
- logging.info("No build file %s", fname)
-
-
-# Try to log information on the last mcu build
-def dump_mcu_build():
- build_dir = os.path.join(os.path.dirname(__file__), "..")
- # Try to log last mcu config
- dump_file_stats(build_dir, ".config")
- try:
- f = open(os.path.join(build_dir, ".config"), "r")
- data = f.read(32 * 1024)
- f.close()
- logging.info(
- "========= Last MCU build config =========\n%s" "=======================",
- data,
- )
- except:
- pass
- # Try to log last mcu build version
- dump_file_stats(build_dir, "out/klipper.dict")
- try:
- f = open(os.path.join(build_dir, "out/klipper.dict"), "r")
- data = f.read(32 * 1024)
- f.close()
- data = json.loads(data)
- logging.info("Last MCU build version: %s", data.get("version", ""))
- logging.info("Last MCU build tools: %s", data.get("build_versions", ""))
- cparts = ["%s=%s" % (k, v) for k, v in data.get("config", {}).items()]
- logging.info("Last MCU build config: %s", " ".join(cparts))
- except:
- pass
- dump_file_stats(build_dir, "out/klipper.elf")
-
-
-######################################################################
# General system and software information
######################################################################