Skip to content

Commit

Permalink
Initial Implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Apr 8, 2024
1 parent 5c43763 commit b73abb1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ If I want my printer to light itself on fire, I should be able to make my printe

- [filament_switch|motion_sensor: runout distance, smart and runout gcode](https://github.com/DangerKlippers/danger-klipper/pull/158)

- [configfile: recursive globs](https://github.com/Klipper3d/klipper/pull/6375) / (https://github.com/DangerKlippers/danger-klipper/pull/200)

If you're feeling adventurous, take a peek at the extra features in the bleeding-edge branch [feature documentation](docs/Bleeding_Edge.md)
and [feature configuration reference](docs/Config_Reference_Bleeding_Edge.md):

Expand Down
2 changes: 1 addition & 1 deletion docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ aliases_<name>:

Include file support. One may include additional config file from the
main printer config file. Wildcards may also be used (eg,
"configs/\*.cfg").
"configs/\*.cfg", or "configs/\*\*/\*.cfg" if using python version >=3.5).

```
[include my_other_config.cfg]
Expand Down
5 changes: 4 additions & 1 deletion klippy/configfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ def _resolve_include(
dirname = os.path.dirname(source_filename)
include_spec = include_spec.strip()
include_glob = os.path.join(dirname, include_spec)
include_filenames = glob.glob(include_glob)
if sys.version_info >= (3, 5):
include_filenames = glob.glob(include_glob, recursive=True)
else:
include_filenames = glob.glob(include_glob)
if not include_filenames and not glob.has_magic(include_glob):
# Empty set is OK if wildcard but not for direct file reference
raise error("Include file '%s' does not exist" % (include_glob,))
Expand Down

0 comments on commit b73abb1

Please sign in to comment.