mirror of https://github.com/Desuuuu/klipper.git
logextract: Better handle the case of a missing config section
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
08444a8b89
commit
3d26bf6635
|
@ -89,10 +89,12 @@ class GatherShutdown:
|
||||||
def __init__(self, configs, line_num, recent_lines, logname):
|
def __init__(self, configs, line_num, recent_lines, logname):
|
||||||
self.shutdown_line_num = line_num
|
self.shutdown_line_num = line_num
|
||||||
self.filename = "%s.shutdown%05d" % (logname, line_num)
|
self.filename = "%s.shutdown%05d" % (logname, line_num)
|
||||||
configs_by_id = {c.config_num: c for c in configs.values()}
|
self.comments = []
|
||||||
self.config = configs_by_id[max(configs_by_id.keys())]
|
if configs:
|
||||||
self.comments = ["# config %s" % (self.config.filename,)]
|
configs_by_id = {c.config_num: c for c in configs.values()}
|
||||||
self.config.add_comment(format_comment(line_num, recent_lines[-1][1]))
|
config = configs_by_id[max(configs_by_id.keys())]
|
||||||
|
config.add_comment(format_comment(line_num, recent_lines[-1][1]))
|
||||||
|
self.comments.append("# config %s" % (self.config.filename,))
|
||||||
self.stats_stream = []
|
self.stats_stream = []
|
||||||
self.gcode_stream = []
|
self.gcode_stream = []
|
||||||
self.mcus = {}
|
self.mcus = {}
|
||||||
|
|
Loading…
Reference in New Issue