mirror of https://github.com/Desuuuu/klipper.git
klippy: Instantiate the webhooks module
Add 'cpu_info' to start_args so it may be reported via the "info" endpoint in webhooks.py. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
475f543790
commit
14ac453861
|
@ -6,7 +6,7 @@
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
import sys, os, optparse, logging, time, threading, collections, importlib
|
import sys, os, optparse, logging, time, threading, collections, importlib
|
||||||
import util, reactor, queuelogger, msgproto, homing
|
import util, reactor, queuelogger, msgproto, homing
|
||||||
import gcode, configfile, pins, mcu, toolhead
|
import gcode, configfile, pins, mcu, toolhead, webhooks
|
||||||
|
|
||||||
message_ready = "Printer is ready"
|
message_ready = "Printer is ready"
|
||||||
|
|
||||||
|
@ -57,8 +57,9 @@ class Printer:
|
||||||
self.in_shutdown_state = False
|
self.in_shutdown_state = False
|
||||||
self.run_result = None
|
self.run_result = None
|
||||||
self.event_handlers = {}
|
self.event_handlers = {}
|
||||||
gc = gcode.GCodeParser(self, input_fd)
|
self.objects = collections.OrderedDict()
|
||||||
self.objects = collections.OrderedDict({'gcode': gc})
|
self.objects['webhooks'] = webhooks.WebHooks(self)
|
||||||
|
self.objects['gcode'] = gcode.GCodeParser(self, input_fd)
|
||||||
def get_start_args(self):
|
def get_start_args(self):
|
||||||
return self.start_args
|
return self.start_args
|
||||||
def get_reactor(self):
|
def get_reactor(self):
|
||||||
|
@ -268,16 +269,18 @@ def main():
|
||||||
start_args['debugoutput'] = options.debugoutput
|
start_args['debugoutput'] = options.debugoutput
|
||||||
start_args.update(options.dictionary)
|
start_args.update(options.dictionary)
|
||||||
if options.logfile:
|
if options.logfile:
|
||||||
|
start_args['log_file'] = options.logfile
|
||||||
bglogger = queuelogger.setup_bg_logging(options.logfile, debuglevel)
|
bglogger = queuelogger.setup_bg_logging(options.logfile, debuglevel)
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(level=debuglevel)
|
logging.basicConfig(level=debuglevel)
|
||||||
logging.info("Starting Klippy...")
|
logging.info("Starting Klippy...")
|
||||||
start_args['software_version'] = util.get_git_version()
|
start_args['software_version'] = util.get_git_version()
|
||||||
|
start_args['cpu_info'] = util.get_cpu_info()
|
||||||
if bglogger is not None:
|
if bglogger is not None:
|
||||||
versions = "\n".join([
|
versions = "\n".join([
|
||||||
"Args: %s" % (sys.argv,),
|
"Args: %s" % (sys.argv,),
|
||||||
"Git version: %s" % (repr(start_args['software_version']),),
|
"Git version: %s" % (repr(start_args['software_version']),),
|
||||||
"CPU: %s" % (util.get_cpu_info(),),
|
"CPU: %s" % (start_args['cpu_info'],),
|
||||||
"Python: %s" % (repr(sys.version),)])
|
"Python: %s" % (repr(sys.version),)])
|
||||||
logging.info(versions)
|
logging.info(versions)
|
||||||
elif not options.debugoutput:
|
elif not options.debugoutput:
|
||||||
|
|
Loading…
Reference in New Issue