Merge commit '24ca655de97ff09758970c4e056309332b390a3b' into devel
This commit is contained in:
commit
0dd67f01e3
|
@ -568,6 +568,30 @@ class KlipperPlugin(
|
||||||
dataToValidated.readfp(buf)
|
dataToValidated.readfp(buf)
|
||||||
else:
|
else:
|
||||||
dataToValidated.read_string(dataToBeValidated)
|
dataToValidated.read_string(dataToBeValidated)
|
||||||
|
|
||||||
|
sections_search_list = ["bltouch",
|
||||||
|
"probe"]
|
||||||
|
value_search_list = [ "x_offset",
|
||||||
|
"y_offset",
|
||||||
|
"z_offset"]
|
||||||
|
try:
|
||||||
|
# cycle through sections and then values
|
||||||
|
for y in sections_search_list:
|
||||||
|
for x in value_search_list:
|
||||||
|
if dataToValidated.has_option(y, x):
|
||||||
|
a_float = dataToValidated.getfloat(y, x)
|
||||||
|
except ValueError as error:
|
||||||
|
self.log_error(
|
||||||
|
"Error: Invalid Value for <b>"+x+"</b> in Section: <b>"+y+"</b>\n" +
|
||||||
|
"{}".format(str(error))
|
||||||
|
)
|
||||||
|
self.send_message("PopUp", "warning", "OctoKlipper: Invalid Config\n",
|
||||||
|
"Config got not saved!\n" +
|
||||||
|
"You can reload your last changes\n" +
|
||||||
|
"on the 'Klipper Configuration' tab.\n\n" +
|
||||||
|
"Invalid Value for <b>"+x+"</b> in Section: <b>"+y+"</b>\n" + "{}".format(str(error)))
|
||||||
|
self._parsing_check_response = False
|
||||||
|
return False
|
||||||
except configparser.Error as error:
|
except configparser.Error as error:
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
error.message = error.message.replace("\\n","")
|
error.message = error.message.replace("\\n","")
|
||||||
|
@ -588,9 +612,10 @@ class KlipperPlugin(
|
||||||
"You can reload your last changes\n" +
|
"You can reload your last changes\n" +
|
||||||
"on the 'Klipper Configuration' tab.\n\n" + str(error))
|
"on the 'Klipper Configuration' tab.\n\n" + str(error))
|
||||||
self._parsing_check_response = False
|
self._parsing_check_response = False
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
self._parsing_check_response = True
|
self._parsing_check_response = True
|
||||||
return
|
return True
|
||||||
|
|
||||||
#incorrectlines = []
|
#incorrectlines = []
|
||||||
# for section in dataToValidated.sections():
|
# for section in dataToValidated.sections():
|
||||||
|
|
|
@ -28,14 +28,14 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
regex: /;.*$/
|
regex: /;.*$/
|
||||||
}, {
|
}, {
|
||||||
token: "comment.line.number-sign",
|
token: "comment.line.number-sign",
|
||||||
regex: /(#\*#)/
|
regex: /^(#\*#)/
|
||||||
}],
|
}],
|
||||||
"#number": [{
|
"#number": [{
|
||||||
token: "constant.numeric",
|
token: "constant.numeric",
|
||||||
regex: /\-?\d+(?:[\.,]\d+)?\b/
|
regex: /\-?\d+(?:[\.]\d+)?\b/
|
||||||
}, {
|
}, {
|
||||||
token: "constant.numeric",
|
token: "constant.numeric",
|
||||||
regex: /\-?[\.,]\d+?\b/
|
regex: /\-?[\.]\d+?\b/
|
||||||
}],
|
}],
|
||||||
"#boolean": [{
|
"#boolean": [{
|
||||||
token: "constant.language",
|
token: "constant.language",
|
||||||
|
@ -112,6 +112,11 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
regex: /\b(?:cartesian|delta|corexy|corexz|polar|rotary_delta|winch|none)\b/,
|
regex: /\b(?:cartesian|delta|corexy|corexz|polar|rotary_delta|winch|none)\b/,
|
||||||
caseInsensitive: true
|
caseInsensitive: true
|
||||||
}],
|
}],
|
||||||
|
"#known_screws_type": [{
|
||||||
|
token: "support.type",
|
||||||
|
regex: /\b(?:CW-M3|CCW-M3|CW-M4|CCW-M4|CW-M5|CCW-M5)\b/,
|
||||||
|
caseInsensitive: true
|
||||||
|
}],
|
||||||
"#known_algo_type": [{
|
"#known_algo_type": [{
|
||||||
token: "support.type",
|
token: "support.type",
|
||||||
regex: /\b(?:lagrange|bicubic)\b/,
|
regex: /\b(?:lagrange|bicubic)\b/,
|
||||||
|
@ -119,7 +124,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}],
|
}],
|
||||||
"#known_display_type": [{
|
"#known_display_type": [{
|
||||||
token: "support.type",
|
token: "support.type",
|
||||||
regex: /\b(?:hd44780|st7920|uc1701|ssd1306|sh1106)\b/,
|
regex: /\b(?:hd44780|st7920|uc1701|ssd1306|emulated_st7920|sh1106)\b/,
|
||||||
caseInsensitive: true
|
caseInsensitive: true
|
||||||
}],
|
}],
|
||||||
"#serial": [{
|
"#serial": [{
|
||||||
|
@ -128,7 +133,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}],
|
}],
|
||||||
"#pin": [{
|
"#pin": [{
|
||||||
token: "support.type",
|
token: "support.type",
|
||||||
regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}/,
|
regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}|(?:probe:z_virtual_endstop)/,
|
||||||
caseInsensitive: true
|
caseInsensitive: true
|
||||||
}, {
|
}, {
|
||||||
token: "support.type",
|
token: "support.type",
|
||||||
|
@ -169,6 +174,8 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
include: "#known_display_type"
|
include: "#known_display_type"
|
||||||
}, {
|
}, {
|
||||||
include: "#known_kinematics_type"
|
include: "#known_kinematics_type"
|
||||||
|
}, {
|
||||||
|
include: "#known_screws_type"
|
||||||
}, {
|
}, {
|
||||||
include: "#known_algo_type"
|
include: "#known_algo_type"
|
||||||
}, {
|
}, {
|
||||||
|
@ -183,6 +190,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
include: "#single_line_comment"
|
include: "#single_line_comment"
|
||||||
}]
|
}]
|
||||||
}],
|
}],
|
||||||
|
// For multiple keys on one line eg.: ^EXP1_5, ^EXP1_3
|
||||||
"#config_line_display": [{
|
"#config_line_display": [{
|
||||||
token: ["variable.name", "text"],
|
token: ["variable.name", "text"],
|
||||||
regex: /(?!(gcode))(\w+)(\s*[=]\s*)/,
|
regex: /(?!(gcode))(\w+)(\s*[=]\s*)/,
|
||||||
|
@ -231,7 +239,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
caseInsensitive: true,
|
caseInsensitive: true,
|
||||||
push: [{
|
push: [{
|
||||||
token: "text",
|
token: "text",
|
||||||
regex: /(\s|$)/,
|
regex: /(?=(\s|$|;))/,
|
||||||
next: "pop"
|
next: "pop"
|
||||||
}, {
|
}, {
|
||||||
include: "#number"
|
include: "#number"
|
||||||
|
@ -241,11 +249,11 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}],
|
}],
|
||||||
"#gcode_parameter": [{
|
"#gcode_parameter": [{
|
||||||
token: "variable.parameter",
|
token: "variable.parameter",
|
||||||
regex: /\b[A-z]+(?![a-z])/,
|
regex: /\b[A-z]+(?![a-z])|(?:<---------------------- SAVE_CONFIG ---------------------->)|(?:\sDO NOT EDIT THIS BLOCK OR BELOW\. The contents are auto\-generated\.)/,
|
||||||
caseInsensitive: true,
|
caseInsensitive: true,
|
||||||
push: [{
|
push: [{
|
||||||
token: "text",
|
token: "text",
|
||||||
regex: /(?=(\s|$))/,
|
regex: /(?=(\s|$|;))|^/,
|
||||||
next: "pop"
|
next: "pop"
|
||||||
}, {
|
}, {
|
||||||
include: "#number"
|
include: "#number"
|
||||||
|
@ -272,7 +280,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
next: "pop"
|
next: "pop"
|
||||||
}, {
|
}, {
|
||||||
token: "constant.language",
|
token: "constant.language",
|
||||||
regex: /5V|average|command|echo|error|manual|median|OD|output_mode_store|pin_down|pin_up|reset|self_test|set_5V_output_mode|set_5V_output_mode|set_OD_output_mode|touch_mode/,
|
regex: /$|5V|average|command|echo|error|manual|median|OD|output_mode_store|pin_down|pin_up|reset|self_test|set_5V_output_mode|set_5V_output_mode|set_OD_output_mode|touch_mode/,
|
||||||
caseInsensitive: true
|
caseInsensitive: true
|
||||||
}, {
|
}, {
|
||||||
include: "#number"
|
include: "#number"
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -19,7 +19,7 @@ plugin_package = "octoprint_klipper"
|
||||||
|
|
||||||
plugin_name = "OctoKlipper"
|
plugin_name = "OctoKlipper"
|
||||||
|
|
||||||
plugin_version = "0.3.8rc3"
|
plugin_version = "0.3.8rc5"
|
||||||
|
|
||||||
plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""
|
plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue