mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 00:03:42 +05:00
Compare commits
16 Commits
v5.1.8
...
b6ee822867
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6ee822867 | ||
|
|
6c81ba2232 | ||
|
|
a777461296 | ||
|
|
2c045bb647 | ||
|
|
a21e059328 | ||
|
|
6853e97fb8 | ||
|
|
837488e4dd | ||
|
|
68cc03f3d0 | ||
|
|
606686b33c | ||
|
|
fc494e21da | ||
|
|
41fccb88fd | ||
|
|
66975cd913 | ||
|
|
89ad92468d | ||
|
|
ef44ba8253 | ||
|
|
d41865e693 | ||
|
|
ba594355ba |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,4 +10,3 @@ __pycache__
|
|||||||
*.code-workspace
|
*.code-workspace
|
||||||
*.iml
|
*.iml
|
||||||
kiauh.cfg
|
kiauh.cfg
|
||||||
klipper_repos.txt
|
|
||||||
|
|||||||
3
.vs/ProjectSettings.json
Normal file
3
.vs/ProjectSettings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"CurrentProjectSetting": null
|
||||||
|
}
|
||||||
11
.vs/VSWorkspaceState.json
Normal file
11
.vs/VSWorkspaceState.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
"",
|
||||||
|
"\\kiauh",
|
||||||
|
"\\kiauh\\components\\droidklipp",
|
||||||
|
"\\kiauh\\core",
|
||||||
|
"\\kiauh\\core\\menus"
|
||||||
|
],
|
||||||
|
"SelectedNode": "\\kiauh\\core\\menus\\main_menu.py",
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
||||||
BIN
.vs/kiauhPlusDroidKlipp/v16/.suo
Normal file
BIN
.vs/kiauhPlusDroidKlipp/v16/.suo
Normal file
Binary file not shown.
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
@@ -71,14 +71,14 @@ sudo apt-get update && sudo apt-get install git -y
|
|||||||
Once git is installed, use the following command to download KIAUH into your home-directory:
|
Once git is installed, use the following command to download KIAUH into your home-directory:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd ~ && git clone https://github.com/dw-0/kiauh.git
|
cd ~ && git clone https://github.com/CodeMasterCody3D/kiauhPlusDroidKlipp.git
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Step 3:** \
|
* **Step 3:** \
|
||||||
Finally, start KIAUH by running the next command:
|
Finally, start KIAUH by running the next command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./kiauh/kiauh.sh
|
./kiauhPlusDroidKlipp/kiauh.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Step 4:** \
|
* **Step 4:** \
|
||||||
|
|||||||
47
kiauh/components/droidklipp/droidklipp.py
Normal file
47
kiauh/components/droidklipp/droidklipp.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def install_droidklipp():
|
||||||
|
try:
|
||||||
|
print("Are you sure you want to install DroidKlipp? (Y/N)")
|
||||||
|
user_confirmation = input().strip().lower()
|
||||||
|
|
||||||
|
if user_confirmation != 'y':
|
||||||
|
print("DroidKlipp installation aborted.")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("Installing DroidKlipp...")
|
||||||
|
subprocess.run(['sudo', 'apt', 'install', '-y', 'adb', 'tmux'], check=True)
|
||||||
|
|
||||||
|
# Define the DroidKlipp repository URL and directory
|
||||||
|
droidklipp_repo_url = "https://github.com/CodeMasterCody3D/DroidKlipp.git"
|
||||||
|
droidklipp_dir = os.path.expanduser('~/DroidKlipp')
|
||||||
|
|
||||||
|
# Check if DroidKlipp directory exists, if not create it
|
||||||
|
if not os.path.isdir(droidklipp_dir):
|
||||||
|
print("DroidKlipp folder not found, creating directory...")
|
||||||
|
os.makedirs(droidklipp_dir)
|
||||||
|
|
||||||
|
# Clone the repository if not already cloned
|
||||||
|
if not os.path.isdir(os.path.join(droidklipp_dir, '.git')):
|
||||||
|
print("Cloning the DroidKlipp repository...")
|
||||||
|
subprocess.run(['git', 'clone', droidklipp_repo_url, droidklipp_dir], check=True)
|
||||||
|
else:
|
||||||
|
print("DroidKlipp repository already exists.")
|
||||||
|
|
||||||
|
# Change to the DroidKlipp directory
|
||||||
|
os.chdir(droidklipp_dir)
|
||||||
|
|
||||||
|
# Set executable permissions for the installation script
|
||||||
|
subprocess.run(['sudo', 'chmod', '+x', 'droidklipp.sh'], check=True)
|
||||||
|
|
||||||
|
# Run the installation script
|
||||||
|
subprocess.run(['./droidklipp.sh'], check=True)
|
||||||
|
|
||||||
|
print("DroidKlipp installation complete!")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"Error during installation: {e}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Unexpected error: {e}")
|
||||||
|
|
||||||
|
# Ensure you call this with proper confirmation before installation
|
||||||
@@ -11,6 +11,7 @@ from __future__ import annotations
|
|||||||
import textwrap
|
import textwrap
|
||||||
from typing import Type
|
from typing import Type
|
||||||
|
|
||||||
|
from components.droidklipp.droidklipp import install_droidklipp
|
||||||
from components.crowsnest.crowsnest import install_crowsnest
|
from components.crowsnest.crowsnest import install_crowsnest
|
||||||
from components.klipper.services.klipper_setup_service import KlipperSetupService
|
from components.klipper.services.klipper_setup_service import KlipperSetupService
|
||||||
from components.klipperscreen.klipperscreen import install_klipperscreen
|
from components.klipperscreen.klipperscreen import install_klipperscreen
|
||||||
@@ -41,7 +42,6 @@ class InstallMenu(BaseMenu):
|
|||||||
|
|
||||||
def set_previous_menu(self, previous_menu: Type[BaseMenu] | None) -> None:
|
def set_previous_menu(self, previous_menu: Type[BaseMenu] | None) -> None:
|
||||||
from core.menus.main_menu import MainMenu
|
from core.menus.main_menu import MainMenu
|
||||||
|
|
||||||
self.previous_menu = previous_menu if previous_menu is not None else MainMenu
|
self.previous_menu = previous_menu if previous_menu is not None else MainMenu
|
||||||
|
|
||||||
def set_options(self) -> None:
|
def set_options(self) -> None:
|
||||||
@@ -53,7 +53,9 @@ class InstallMenu(BaseMenu):
|
|||||||
"5": Option(method=self.install_mainsail_config),
|
"5": Option(method=self.install_mainsail_config),
|
||||||
"6": Option(method=self.install_fluidd_config),
|
"6": Option(method=self.install_fluidd_config),
|
||||||
"7": Option(method=self.install_klipperscreen),
|
"7": Option(method=self.install_klipperscreen),
|
||||||
"8": Option(method=self.install_crowsnest),
|
"8": Option(method=self.install_droidklipp), # Add DroidKlipp option
|
||||||
|
"9": Option(method=self.install_crowsnest),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def print_menu(self) -> None:
|
def print_menu(self) -> None:
|
||||||
@@ -62,15 +64,17 @@ class InstallMenu(BaseMenu):
|
|||||||
╟───────────────────────────┬───────────────────────────╢
|
╟───────────────────────────┬───────────────────────────╢
|
||||||
║ Firmware & API: │ Touchscreen GUI: ║
|
║ Firmware & API: │ Touchscreen GUI: ║
|
||||||
║ 1) [Klipper] │ 7) [KlipperScreen] ║
|
║ 1) [Klipper] │ 7) [KlipperScreen] ║
|
||||||
║ 2) [Moonraker] │ ║
|
║ 2) [Moonraker] │ 8) [DroidKlipp] ║
|
||||||
|
║ │ ║
|
||||||
║ │ Webcam Streamer: ║
|
║ │ Webcam Streamer: ║
|
||||||
║ Webinterface: │ 8) [Crowsnest] ║
|
║ Webinterface: │ 9) [Crowsnest] ║
|
||||||
║ 3) [Mainsail] │ ║
|
║ 3) [Mainsail] │ ║
|
||||||
║ 4) [Fluidd] │ ║
|
║ 4) [Fluidd] │ ║
|
||||||
║ │ ║
|
║ │ ║
|
||||||
║ Client-Config: │ ║
|
║ Client-Config: │ ║
|
||||||
║ 5) [Mainsail-Config] │ ║
|
║ 5) [Mainsail-Config] │ ║
|
||||||
║ 6) [Fluidd-Config] │ ║
|
║ 6) [Fluidd-Config] │ ║
|
||||||
|
║ │ ║
|
||||||
╟───────────────────────────┴───────────────────────────╢
|
╟───────────────────────────┴───────────────────────────╢
|
||||||
"""
|
"""
|
||||||
)[1:]
|
)[1:]
|
||||||
@@ -107,3 +111,6 @@ class InstallMenu(BaseMenu):
|
|||||||
|
|
||||||
def install_crowsnest(self, **kwargs) -> None:
|
def install_crowsnest(self, **kwargs) -> None:
|
||||||
install_crowsnest()
|
install_crowsnest()
|
||||||
|
|
||||||
|
def install_droidklipp(self, **kwargs) -> None:
|
||||||
|
install_droidklipp()
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import sys
|
|||||||
import textwrap
|
import textwrap
|
||||||
from typing import Callable, Type
|
from typing import Callable, Type
|
||||||
|
|
||||||
|
from components.droidklipp.droidklipp import install_droidklipp
|
||||||
from components.crowsnest.crowsnest import get_crowsnest_status
|
from components.crowsnest.crowsnest import get_crowsnest_status
|
||||||
from components.klipper.klipper_utils import get_klipper_status
|
from components.klipper.klipper_utils import get_klipper_status
|
||||||
from components.klipperscreen.klipperscreen import get_klipperscreen_status
|
from components.klipperscreen.klipperscreen import get_klipperscreen_status
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ Specialized for handling Klipper style config files.
|
|||||||
- Option Block: A line starting with a word, followed by a `:` or `=` and a newline
|
- Option Block: A line starting with a word, followed by a `:` or `=` and a newline
|
||||||
- Comment: A line starting with a `#` or `;`
|
- Comment: A line starting with a `#` or `;`
|
||||||
- Blank: A line containing only whitespace characters
|
- Blank: A line containing only whitespace characters
|
||||||
- SaveConfig: Klippers auto-generated SAVE_CONFIG section that can be found at the very end of the config file
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -49,9 +49,6 @@ LINE_COMMENT_RE = re.compile(r"^\s*[#;].*")
|
|||||||
# - the line MUST contain only whitespace characters
|
# - the line MUST contain only whitespace characters
|
||||||
EMPTY_LINE_RE = re.compile(r"^\s*$")
|
EMPTY_LINE_RE = re.compile(r"^\s*$")
|
||||||
|
|
||||||
SAVE_CONFIG_START_RE = re.compile(r"^#\*# <-+ SAVE_CONFIG -+>$")
|
|
||||||
SAVE_CONFIG_CONTENT_RE = re.compile(r"^#\*#.*$")
|
|
||||||
|
|
||||||
BOOLEAN_STATES = {
|
BOOLEAN_STATES = {
|
||||||
"1": True,
|
"1": True,
|
||||||
"yes": True,
|
"yes": True,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from ..simple_config_parser.constants import (
|
|||||||
LINE_COMMENT_RE,
|
LINE_COMMENT_RE,
|
||||||
OPTION_RE,
|
OPTION_RE,
|
||||||
OPTIONS_BLOCK_START_RE,
|
OPTIONS_BLOCK_START_RE,
|
||||||
SECTION_RE, LineType, INDENT, SAVE_CONFIG_START_RE, SAVE_CONFIG_CONTENT_RE,
|
SECTION_RE, LineType, INDENT,
|
||||||
)
|
)
|
||||||
|
|
||||||
_UNSET = object()
|
_UNSET = object()
|
||||||
@@ -61,34 +61,25 @@ class SimpleConfigParser:
|
|||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.header: List[str] = []
|
self.header: List[str] = []
|
||||||
self.save_config_block: List[str] = []
|
|
||||||
self.config: Dict = {}
|
self.config: Dict = {}
|
||||||
self.current_section: str | None = None
|
self.current_section: str | None = None
|
||||||
self.current_opt_block: str | None = None
|
self.current_opt_block: str | None = None
|
||||||
self.in_option_block: bool = False
|
self.in_option_block: bool = False
|
||||||
|
|
||||||
def _match_section(self, line: str) -> bool:
|
def _match_section(self, line: str) -> bool:
|
||||||
"""Whether the given line matches the definition of a section"""
|
"""Wheter or not the given line matches the definition of a section"""
|
||||||
return SECTION_RE.match(line) is not None
|
return SECTION_RE.match(line) is not None
|
||||||
|
|
||||||
def _match_option(self, line: str) -> bool:
|
def _match_option(self, line: str) -> bool:
|
||||||
"""Whether the given line matches the definition of an option"""
|
"""Wheter or not the given line matches the definition of an option"""
|
||||||
return OPTION_RE.match(line) is not None
|
return OPTION_RE.match(line) is not None
|
||||||
|
|
||||||
def _match_options_block_start(self, line: str) -> bool:
|
def _match_options_block_start(self, line: str) -> bool:
|
||||||
"""Whether the given line matches the definition of a multiline option"""
|
"""Wheter or not the given line matches the definition of a multiline option"""
|
||||||
return OPTIONS_BLOCK_START_RE.match(line) is not None
|
return OPTIONS_BLOCK_START_RE.match(line) is not None
|
||||||
|
|
||||||
def _match_save_config_start(self, line: str) -> bool:
|
|
||||||
"""Whether the given line matches the definition of a save config start"""
|
|
||||||
return SAVE_CONFIG_START_RE.match(line) is not None
|
|
||||||
|
|
||||||
def _match_save_config_content(self, line: str) -> bool:
|
|
||||||
"""Whether the given line matches the definition of a save config content"""
|
|
||||||
return SAVE_CONFIG_CONTENT_RE.match(line) is not None
|
|
||||||
|
|
||||||
def _match_line_comment(self, line: str) -> bool:
|
def _match_line_comment(self, line: str) -> bool:
|
||||||
"""Whether the given line matches the definition of a comment"""
|
"""Wheter or not the given line matches the definition of a comment"""
|
||||||
return LINE_COMMENT_RE.match(line) is not None
|
return LINE_COMMENT_RE.match(line) is not None
|
||||||
|
|
||||||
def _match_empty_line(self, line: str) -> bool:
|
def _match_empty_line(self, line: str) -> bool:
|
||||||
@@ -133,14 +124,6 @@ class SimpleConfigParser:
|
|||||||
element["value"].append(line.strip()) # indentation is removed
|
element["value"].append(line.strip()) # indentation is removed
|
||||||
break
|
break
|
||||||
|
|
||||||
elif self._match_save_config_start(line):
|
|
||||||
self.current_opt_block = None
|
|
||||||
self.save_config_block.append(line)
|
|
||||||
|
|
||||||
elif self._match_save_config_content(line):
|
|
||||||
self.current_opt_block = None
|
|
||||||
self.save_config_block.append(line)
|
|
||||||
|
|
||||||
elif self._match_empty_line(line) or self._match_line_comment(line):
|
elif self._match_empty_line(line) or self._match_line_comment(line):
|
||||||
self.current_opt_block = None
|
self.current_opt_block = None
|
||||||
|
|
||||||
@@ -202,11 +185,6 @@ class SimpleConfigParser:
|
|||||||
if not last_line.endswith("\n"):
|
if not last_line.endswith("\n"):
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
if self.save_config_block:
|
|
||||||
for line in self.save_config_block:
|
|
||||||
f.write(line)
|
|
||||||
f.write("\n")
|
|
||||||
|
|
||||||
def get_sections(self) -> List[str]:
|
def get_sections(self) -> List[str]:
|
||||||
"""Return a list of all section names, but exclude any section starting with '#_'"""
|
"""Return a list of all section names, but exclude any section starting with '#_'"""
|
||||||
return list(
|
return list(
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
# a comment at the very top
|
|
||||||
# should be treated as the file header
|
|
||||||
|
|
||||||
# up to the first section, including all blank lines
|
|
||||||
|
|
||||||
[section_1]
|
|
||||||
option_1: value_1
|
|
||||||
option_1_1: True # this is a boolean
|
|
||||||
option_1_2: 5 ; this is an integer
|
|
||||||
option_1_3: 1.123 #;this is a float
|
|
||||||
|
|
||||||
[section_2] ; comment
|
|
||||||
option_2: value_2
|
|
||||||
|
|
||||||
; comment
|
|
||||||
|
|
||||||
[section_3]
|
|
||||||
option_3: value_3 # comment
|
|
||||||
|
|
||||||
[section_4]
|
|
||||||
# comment
|
|
||||||
option_4: value_4
|
|
||||||
|
|
||||||
[section number 5]
|
|
||||||
#option_5: value_5
|
|
||||||
option_5 = this.is.value-5
|
|
||||||
multi_option:
|
|
||||||
# these are multi-line values
|
|
||||||
value_5_1
|
|
||||||
value_5_2 ; here is a comment
|
|
||||||
value_5_3
|
|
||||||
option_5_1: value_5_1
|
|
||||||
|
|
||||||
[gcode_macro M117]
|
|
||||||
rename_existing: M117.1
|
|
||||||
gcode:
|
|
||||||
{% if rawparams %}
|
|
||||||
{% set escaped_msg = rawparams.split(';', 1)[0].split('\x23', 1)[0]|replace('"', '\\"') %}
|
|
||||||
SET_DISPLAY_TEXT MSG="{escaped_msg}"
|
|
||||||
RESPOND TYPE=command MSG="{escaped_msg}"
|
|
||||||
{% else %}
|
|
||||||
SET_DISPLAY_TEXT
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# SDCard 'looping' (aka Marlin M808 commands) support
|
|
||||||
#
|
|
||||||
# Support SDCard looping
|
|
||||||
[sdcard_loop]
|
|
||||||
[gcode_macro M486]
|
|
||||||
gcode:
|
|
||||||
# Parameters known to M486 are as follows:
|
|
||||||
# [C<flag>] Cancel the current object
|
|
||||||
# [P<index>] Cancel the object with the given index
|
|
||||||
# [S<index>] Set the index of the current object.
|
|
||||||
# If the object with the given index has been canceled, this will cause
|
|
||||||
# the firmware to skip to the next object. The value -1 is used to
|
|
||||||
# indicate something that isn’t an object and shouldn’t be skipped.
|
|
||||||
# [T<count>] Reset the state and set the number of objects
|
|
||||||
# [U<index>] Un-cancel the object with the given index. This command will be
|
|
||||||
# ignored if the object has already been skipped
|
|
||||||
|
|
||||||
{% if 'exclude_object' not in printer %}
|
|
||||||
{action_raise_error("[exclude_object] is not enabled")}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'T' in params %}
|
|
||||||
EXCLUDE_OBJECT RESET=1
|
|
||||||
|
|
||||||
{% for i in range(params.T | int) %}
|
|
||||||
EXCLUDE_OBJECT_DEFINE NAME={i}
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'C' in params %}
|
|
||||||
EXCLUDE_OBJECT CURRENT=1
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'P' in params %}
|
|
||||||
EXCLUDE_OBJECT NAME={params.P}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'S' in params %}
|
|
||||||
{% if params.S == '-1' %}
|
|
||||||
{% if printer.exclude_object.current_object %}
|
|
||||||
EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object}
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
EXCLUDE_OBJECT_START NAME={params.S}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if 'U' in params %}
|
|
||||||
EXCLUDE_OBJECT RESET=1 NAME={params.U}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
|
||||||
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
|
||||||
#*#
|
|
||||||
#*# [bed_mesh default]
|
|
||||||
#*# version = 1
|
|
||||||
#*# points =
|
|
||||||
#*# -0.152500, -0.133125, -0.113125, -0.159375, -0.232500
|
|
||||||
#*# -0.095000, -0.078750, -0.068125, -0.133125, -0.235000
|
|
||||||
#*# -0.092500, -0.040625, 0.004375, -0.077500, -0.193125
|
|
||||||
#*# -0.073750, 0.023750, 0.085625, 0.026875, -0.085000
|
|
||||||
#*# -0.140625, 0.038125, 0.126250, 0.097500, 0.003750
|
|
||||||
#*# tension = 0.2
|
|
||||||
#*# min_x = 26.0
|
|
||||||
#*# algo = bicubic
|
|
||||||
#*# y_count = 5
|
|
||||||
#*# mesh_y_pps = 2
|
|
||||||
#*# min_y = 5.0
|
|
||||||
#*# x_count = 5
|
|
||||||
#*# max_y = 174.0
|
|
||||||
#*# mesh_x_pps = 2
|
|
||||||
#*# max_x = 194.0
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#*# any content
|
|
||||||
#*#
|
|
||||||
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
|
||||||
#*#
|
|
||||||
#*# [bed_mesh default]
|
|
||||||
#*# version = 1
|
|
||||||
#*# points =
|
|
||||||
#*# -0.152500, -0.133125, -0.113125, -0.159375, -0.232500
|
|
||||||
#*# -0.095000, -0.078750, -0.068125, -0.133125, -0.235000
|
|
||||||
#*# -0.092500, -0.040625, 0.004375, -0.077500, -0.193125
|
|
||||||
#*# -0.073750, 0.023750, 0.085625, 0.026875, -0.085000
|
|
||||||
#*# -0.140625, 0.038125, 0.126250, 0.097500, 0.003750
|
|
||||||
#*# tension = 0.2
|
|
||||||
#*# min_x = 26.0
|
|
||||||
#*# algo = bicubic
|
|
||||||
#*# y_count = 5
|
|
||||||
#*# mesh_y_pps = 2
|
|
||||||
#*# min_y = 5.0
|
|
||||||
#*# x_count = 5
|
|
||||||
#*# max_y = 174.0
|
|
||||||
#*# mesh_x_pps = 2
|
|
||||||
#*# max_x = 194.0
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#*# leading space prevents match
|
|
||||||
random
|
|
||||||
*# not starting with hash-star-hash
|
|
||||||
# *# spaced out
|
|
||||||
<- SAVE_CONFIG ->
|
|
||||||
;#*# semicolon first
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# ======================================================================= #
|
|
||||||
# Copyright (C) 2024 Dominik Willner <th33xitus@gmail.com> #
|
|
||||||
# #
|
|
||||||
# https://github.com/dw-0/simple-config-parser #
|
|
||||||
# #
|
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
|
||||||
# ======================================================================= #
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from src.simple_config_parser.simple_config_parser import SimpleConfigParser
|
|
||||||
from tests.utils import load_testdata_from_file
|
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).parent.joinpath("test_data")
|
|
||||||
MATCHING_TEST_DATA_PATH = BASE_DIR.joinpath("matching_data.txt")
|
|
||||||
NON_MATCHING_TEST_DATA_PATH = BASE_DIR.joinpath("non_matching_data.txt")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def parser():
|
|
||||||
return SimpleConfigParser()
|
|
||||||
|
|
||||||
|
|
||||||
def test_matching_lines(parser):
|
|
||||||
"""Alle Zeilen in matching_data.txt sollen als Save-Config-Content erkannt werden."""
|
|
||||||
matching_lines = load_testdata_from_file(MATCHING_TEST_DATA_PATH)
|
|
||||||
for line in matching_lines:
|
|
||||||
assert parser._match_save_config_content(line) is True, f"Line should be a save config content: {line!r}"
|
|
||||||
|
|
||||||
|
|
||||||
def test_non_matching_lines(parser):
|
|
||||||
"""Alle Zeilen in non_matching_data.txt sollen NICHT als Save-Config-Content erkannt werden."""
|
|
||||||
non_matching_lines = load_testdata_from_file(NON_MATCHING_TEST_DATA_PATH)
|
|
||||||
for line in non_matching_lines:
|
|
||||||
assert parser._match_save_config_content(line) is False, f"Line should not be a save config content: {line!r}"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#*# <- SAVE_CONFIG ->
|
|
||||||
#*# <---- SAVE_CONFIG ---->
|
|
||||||
#*# <------------------- SAVE_CONFIG ------------------->
|
|
||||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
|
||||||
#*# <----- SAVE_CONFIG ->
|
|
||||||
#*# <- SAVE_CONFIG ----------------->
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#*#<- SAVE_CONFIG ->
|
|
||||||
#*# <-SAVE_CONFIG ->
|
|
||||||
#*# <- SAVE_CONFIG->
|
|
||||||
#*# <- SAVE_CONFIG -> extra
|
|
||||||
#*# SAVE_CONFIG ---->
|
|
||||||
#*# < SAVE_CONFIG >
|
|
||||||
# *# <- SAVE_CONFIG ->
|
|
||||||
<- SAVE_CONFIG ->
|
|
||||||
random text
|
|
||||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
|
||||||
#*# <---------------------- SAVE_CONFIG ----------------------> #*#
|
|
||||||
#*# <-------------------------------------------->
|
|
||||||
#*# SAVE_CONFIG
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# ======================================================================= #
|
|
||||||
# Copyright (C) 2024 Dominik Willner <th33xitus@gmail.com> #
|
|
||||||
# #
|
|
||||||
# https://github.com/dw-0/simple-config-parser #
|
|
||||||
# #
|
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license #
|
|
||||||
# ======================================================================= #
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from src.simple_config_parser.simple_config_parser import SimpleConfigParser
|
|
||||||
from tests.utils import load_testdata_from_file
|
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).parent.joinpath("test_data")
|
|
||||||
MATCHING_TEST_DATA_PATH = BASE_DIR.joinpath("matching_data.txt")
|
|
||||||
NON_MATCHING_TEST_DATA_PATH = BASE_DIR.joinpath("non_matching_data.txt")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def parser():
|
|
||||||
return SimpleConfigParser()
|
|
||||||
|
|
||||||
|
|
||||||
def test_matching_lines(parser):
|
|
||||||
"""Test that all lines in the matching data file are correctly identified as save config start lines."""
|
|
||||||
matching_lines = load_testdata_from_file(MATCHING_TEST_DATA_PATH)
|
|
||||||
for line in matching_lines:
|
|
||||||
assert parser._match_save_config_start(line) is True, f"Line should be a save config start: {line!r}"
|
|
||||||
|
|
||||||
|
|
||||||
def test_non_matching_lines(parser):
|
|
||||||
"""Test that all lines in the non-matching data file are correctly identified as not save config start lines."""
|
|
||||||
non_matching_lines = load_testdata_from_file(NON_MATCHING_TEST_DATA_PATH)
|
|
||||||
for line in non_matching_lines:
|
|
||||||
assert parser._match_save_config_start(line) is False, f"Line should not be a save config start: {line!r}"
|
|
||||||
@@ -13,7 +13,7 @@ from src.simple_config_parser.simple_config_parser import SimpleConfigParser
|
|||||||
from tests.utils import load_testdata_from_file
|
from tests.utils import load_testdata_from_file
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).parent.parent.joinpath("assets")
|
BASE_DIR = Path(__file__).parent.parent.joinpath("assets")
|
||||||
CONFIG_FILES = ["test_config_1.cfg", "test_config_2.cfg", "test_config_3.cfg", "test_config_4.cfg"]
|
CONFIG_FILES = ["test_config_1.cfg", "test_config_2.cfg", "test_config_3.cfg"]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(params=CONFIG_FILES)
|
@pytest.fixture(params=CONFIG_FILES)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from components.droidklipp.droidklipp import install_droidklipp
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# This file acts as an example file.
|
|
||||||
#
|
|
||||||
# 1) Make a copy of this file and rename it to 'klipper_repos.txt'
|
|
||||||
# 2) Add your custom Klipper repository to the bottom of that copy
|
|
||||||
# 3) Save the file
|
|
||||||
#
|
|
||||||
# Back in KIAUH you can now go into -> [Settings] and use action '2' to set a different Klipper repository
|
|
||||||
#
|
|
||||||
# Make sure to always separate the repository and the branch with a ','.
|
|
||||||
# <repository>,<branch> -> https://github.com/Klipper3d/klipper,master
|
|
||||||
# If you omit a branch, it will always default to 'master'
|
|
||||||
#
|
|
||||||
# You are allowed to omit the 'https://github.com/' part of the repository URL
|
|
||||||
# Down below are now a few examples of what is considered as valid:
|
|
||||||
https://github.com/Klipper3d/klipper,master
|
|
||||||
https://github.com/Klipper3d/klipper
|
|
||||||
Klipper3d/klipper,master
|
|
||||||
Klipper3d/klipper
|
|
||||||
Reference in New Issue
Block a user