Skip to content

Commit 25ce84b

Browse files
committed
Merge branch 'non_verbose' into 'main'
added verbosity control for prints & prog bar See merge request kit/fast/lb/collaboration/additive-manufacturing/pygcodedecode!40
2 parents b56597f + da299e5 commit 25ce84b

File tree

7 files changed

+150
-91
lines changed

7 files changed

+150
-91
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ repos:
1313
- --maxkb=5000
1414
# Black code style formatter
1515
- repo: https://github.com/psf/black
16-
rev: 24.10.0
16+
rev: 25.1.0
1717
hooks:
1818
- id: black
1919
- id: black-jupyter
2020
# isort import sorting
2121
- repo: https://github.com/timothycrosley/isort
22-
rev: "5.13.2"
22+
rev: "6.0.1"
2323
hooks:
2424
- id: isort
2525
args: ["--profile", "black"]
2626
# Flake8 for linting
2727
- repo: https://github.com/pycqa/flake8
28-
rev: "7.1.1"
28+
rev: "7.1.2"
2929
hooks:
3030
- id: flake8
3131
additional_dependencies: [flake8-docstrings]
@@ -36,6 +36,6 @@ repos:
3636
- id: nbstripout
3737
# pyupgrade
3838
- repo: https://github.com/asottile/pyupgrade
39-
rev: v3.19.0
39+
rev: v3.19.1
4040
hooks:
4141
- id: pyupgrade

pyGCodeDecode/cli.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@ def _find_gcode_file(specified_path: pathlib.Path | None) -> pathlib.Path:
2929
g_code_file = specified_path
3030
elif specified_path is not None:
3131
custom_print(
32-
f"❌ The specified G-code:\n{specified_path.resolve()}\nis not valid.\n" "🛑 Exiting the program."
32+
f"❌ The specified G-code:\n{specified_path.resolve()}\nis not valid.\n" "🛑 Exiting the program.",
33+
lvl=1,
3334
)
3435
exit()
3536
else:
36-
custom_print("⚠️ No G-code file specified. Looking for a G-code file in the current directory... 👀")
37+
custom_print("⚠️ No G-code file specified. Looking for a G-code file in the current directory... 👀", lvl=1)
3738
files_list = list(pathlib.Path.cwd().glob("*.gcode"))
3839
if files_list.__len__() == 0:
39-
custom_print("❌ No G-code file found in the current directory.\n" "🛑 Exiting the program.")
40+
custom_print("❌ No G-code file found in the current directory.\n" "🛑 Exiting the program.", lvl=1)
4041
exit()
4142
elif files_list.__len__() == 1:
4243
g_code_file = files_list[0]
4344
else:
44-
custom_print("❌ Multiple G-code files found in the current directory:")
45+
custom_print("❌ Multiple G-code files found in the current directory:", lvl=1)
4546
for file in files_list:
46-
custom_print(f" - {file.resolve()}")
47-
custom_print("🛑 Exiting the program.")
47+
custom_print(f" - {file.resolve()}", lvl=1)
48+
custom_print("🛑 Exiting the program.", lvl=1)
4849
exit()
4950

5051
custom_print(f"✅ Using the G-code file:\n{g_code_file.resolve()}")
@@ -57,7 +58,8 @@ def _get_presets_file(presets_file: pathlib.Path | None) -> pathlib.Path:
5758
presets_file = importlib.resources.files("pyGCodeDecode").joinpath("data/default_printer_presets.yaml")
5859
elif not presets_file.is_file():
5960
custom_print(
60-
f"❌ The specified presets file:\n{presets_file.resolve()}\nis not valid.\n" "🛑 Exiting the program."
61+
f"❌ The specified presets file:\n{presets_file.resolve()}\nis not valid.\n" "🛑 Exiting the program.",
62+
lvl=1,
6163
)
6264
exit()
6365
else:

0 commit comments

Comments
 (0)