mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 16:23:36 +05:00
Merge commit '64de883b3f40322c5048745af0a5eef5be570616' into feat/obico-for-v6
This commit is contained in:
@@ -85,7 +85,7 @@ class DuplicateOptionError(Exception):
|
|||||||
class SimpleConfigParser:
|
class SimpleConfigParser:
|
||||||
"""A customized config parser targeted at handling Klipper style config files"""
|
"""A customized config parser targeted at handling Klipper style config files"""
|
||||||
|
|
||||||
_SECTION_RE = re.compile(r"\s*\[(\w+\s?[\w\-]+)]\s*([#;].*)?$")
|
_SECTION_RE = re.compile(r"\s*\[(\w+\s?.+)]\s*([#;].*)?$")
|
||||||
_OPTION_RE = re.compile(r"^\s*(\w+)\s*[:=]\s*([^=:].*)\s*([#;].*)?$")
|
_OPTION_RE = re.compile(r"^\s*(\w+)\s*[:=]\s*([^=:].*)\s*([#;].*)?$")
|
||||||
_MLOPTION_RE = re.compile(r"^\s*(\w+)\s*[:=]\s*([#;].*)?$")
|
_MLOPTION_RE = re.compile(r"^\s*(\w+)\s*[:=]\s*([#;].*)?$")
|
||||||
_COMMENT_RE = re.compile(r"^\s*([#;].*)?$")
|
_COMMENT_RE = re.compile(r"^\s*([#;].*)?$")
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ testcases = [
|
|||||||
("option: value\n", "option", "value"),
|
("option: value\n", "option", "value"),
|
||||||
("option: value # inline comment", "option", "value"),
|
("option: value # inline comment", "option", "value"),
|
||||||
("option: value # inline comment\n", "option", "value"),
|
("option: value # inline comment\n", "option", "value"),
|
||||||
|
(
|
||||||
|
"description: Helper: park toolhead used in PAUSE and CANCEL_PRINT",
|
||||||
|
"description",
|
||||||
|
"Helper: park toolhead used in PAUSE and CANCEL_PRINT",
|
||||||
|
),
|
||||||
("description: homing!", "description", "homing!"),
|
("description: homing!", "description", "homing!"),
|
||||||
("description: inline macro :-)", "description", "inline macro :-)"),
|
("description: inline macro :-)", "description", "inline macro :-)"),
|
||||||
("path: %GCODES_DIR%", "path", "%GCODES_DIR%"),
|
("path: %GCODES_DIR%", "path", "%GCODES_DIR%"),
|
||||||
|
|||||||
@@ -3,4 +3,6 @@ testcases = [
|
|||||||
("[test_section two]", "test_section two"),
|
("[test_section two]", "test_section two"),
|
||||||
("[section1] # inline comment", "section1"),
|
("[section1] # inline comment", "section1"),
|
||||||
("[section2] ; second comment", "section2"),
|
("[section2] ; second comment", "section2"),
|
||||||
|
("[include moonraker-obico-update.cfg]", "include moonraker-obico-update.cfg"),
|
||||||
|
("[include moonraker_obico_macros.cfg]", "include moonraker_obico_macros.cfg"),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
testcases = [
|
testcases = [
|
||||||
("[example_section]", True),
|
("[example_section]", True),
|
||||||
|
("[gcode_macro CANCEL_PRINT]", True),
|
||||||
|
("[gcode_macro SET_PAUSE_NEXT_LAYER]", True),
|
||||||
|
("[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]", True),
|
||||||
("[update_manager moonraker-obico]", True),
|
("[update_manager moonraker-obico]", True),
|
||||||
|
("[include moonraker_obico_macros.cfg]", True),
|
||||||
|
("[include moonraker-obico-update.cfg]", True),
|
||||||
("[example_section two]", True),
|
("[example_section two]", True),
|
||||||
("not_a_valid_section", False),
|
("not_a_valid_section", False),
|
||||||
("section: invalid", False),
|
("section: invalid", False),
|
||||||
|
|||||||
Reference in New Issue
Block a user