Commit Graph

16 Commits

Author SHA1 Message Date
Kevin O'Connor f9ca5b9098 configfile: Add helpers for parsing list of parameters from the config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 8cc1d84180 configfile: Add printer.configfile.settings command template parameter
Make available the parsed value (or default value) for config options
to command templates and to the api server.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-20 16:25:25 -05:00
Kevin O'Connor 16963a8e1a configfile: Improve error message when a required option is missing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-22 20:07:39 -05:00
Kevin O'Connor ca8e6ad89b configfile: Minor line wrapping changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-22 20:06:15 -05:00
Eric Callahan a8e3afd64a
configfile: report "save_config_pending" via get_status() (#3372)
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-28 00:05:55 -04:00
Kevin O'Connor a1fc1ac214 configfile: Use "import ConfigParser as configparser"
This minor change makes it easier to port the code to Python3.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-15 17:15:53 -04:00
Kevin O'Connor 492cd3d99f configfile: Fix check for unused config sections and options
Commit c3899cef inadvertently broke the error check for unused config
options.  Add a new note_valid parameter to the config access wrappers
and use that in get_status() to fix the check.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-21 17:50:51 -04:00
Kevin O'Connor c186766708 configfile: Use new GCodeCommand wrappers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-05 11:08:11 -04:00
Kevin O'Connor c3899cefa8 configfile: Add get_status() to export raw config file information
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-13 22:04:40 -05:00
Kevin O'Connor fdfa26edd6 delta_calibrate: Move stable position conversion to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:41:09 -05:00
Julien Lirochon 12feb6d7fb configfile: Fix the exception raised when an included file is missing (#1931)
Signed-off-by: Julien Lirochon <julien@lirochon.net>
2019-09-01 18:28:18 -04:00
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