Commit Graph

5 Commits

Author SHA1 Message Date
lauckhart 7a344acde8 configfile: Add "include" support (#1359)
Allows configuration files to include other configuration files using
[include filename.cfg] syntax.  Klippy loads include files in the
position of the include header; subsequent definitions override
included values.  Supports wildcards (e.g. [include macros/*.cfg).
Allows included files to include other files but blocks recursion.

Signed-off-by: Greg Lauckhart <greg@lauckhart.com>
2019-03-22 20:31:40 -04:00
Kevin O'Connor 08d03ae0eb configfile: Strip trailing comments
The Python 2.x ConfigParser doesn't support stripping of trailing '#'
style comments.  Do that manually before parsing the config.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 11:45:20 -04:00
Janar Sööt d9e35481be configfile: add get_prefix_options method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-30 11:51:26 -04:00
Kevin O'Connor 531134f092 configfile: Add support for rewriting the printer config file
Add support for writing back the main printer config file with
additional calibration data stored in it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor f80456a698 configfile: Move config file code from klippy.py to new file
Add a klippy/configfile.py file with the code needed to read the main
printer config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00