aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/util.py
Commit message (Collapse)AuthorAgeFilesLines
* util: report git version info as a dictEric Callahan2023-05-041-4/+13
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* klippy: report repo branch, remote, and tracking urlEric Callahan2023-05-041-3/+53
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* klippy: Report repo version as "dirty" if there are untracked python filesKevin O'Connor2023-05-021-6/+16
| | | | | | | | Check for untracked files in the klippy/extras/ and klippy/kinematics/ directories and report those files in the log. This helps identify code modifications when inspecting a log. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Use regular str() type in get_git_version() on Python2Kevin O'Connor2021-10-311-1/+1
| | | | | | | Avoid using unicode() types on Python2 as it can lead to subtle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* configfile: Use Python2's ConfigParser when running on Python2Kevin O'Connor2021-10-091-1/+2
| | | | | | | | | The backport of Python3's configparser causes issues when there is unicode characters in the config file. To avoid introducing new errors, go back to using the Python2 version of ConfigParser when running on Python2. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* scripts: Use backport of a recent Python3 configparser on Python2Kevin O'Connor2021-10-041-7/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Add Python2 module wrappers and use Python3 module namingKevin O'Connor2021-10-041-0/+21
| | | | | | | Add wrappers for some common Python modules so that the code can run on both Python2 and Python3. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Convert to Python3 string encodingKevin O'Connor2021-10-011-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Improve Python3 compatibilityKevin O'Connor2020-06-151-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Try to dump mcu build information on a connection errorKevin O'Connor2020-03-221-2/+55
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Ignore errors in clear_hupcl (allows OSX to run)LyleCheatham2019-05-201-1/+4
| | | | Signed-off-by: Lyle Cheatham <hello@lylecheatham.com>
* util: Wrap code to 80 columnsKevin O'Connor2019-02-271-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Don't crash when calling get_cpu_info on OS X (#1102)Víctor Martínez2019-01-111-1/+1
| | | Signed-off-by: Víctor Martínez <knoopx@gmail.com>
* util: Fix versioning when gitdir is absent (#809)lf2018-10-271-11/+24
| | | | | | | | | | | | | The gitdir previously could be absent and produce a version of "" in spite of checks for it. Fixed. Parent directories with shlex-interpreted characters in their names could be misinterpreted. Removed shlex parsing. Packagers may want to remove the git history to slim down the package size, so add an option for using a file 'version' in the klippy directory to set version without using git. Signed-Off-By: Lucas Fink <software@lfcode.ca>
* util: Change the /tmp/printer pty to be group readableKevin O'Connor2018-05-161-1/+3
| | | | | | | | For some reason, Linux creates the pseudo tty with group writable permissions, but not group readable. Use chmod to allow the device to also be group readable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use git describe --alwaysKevin O'Connor2018-02-261-1/+1
| | | | | | | | Add --always flag to "git describe" command to get a build identifier even if one checks out the repo with a depth parameter that prunes out the last tagged version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Call set_nonblock() in create_pty()Kevin O'Connor2018-02-021-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Avoid using '%' syntax when calling logging moduleKevin O'Connor2017-09-271-3/+3
| | | | | | | The logging module can build strings directly from printf syntax - no need to build the string first. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Fix reporting of git version of klippy codeKevin O'Connor2017-09-071-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Log the type of cpu the host is running onKevin O'Connor2017-02-121-0/+15
| | | | | | | | Report in the log the host CPU type and count. This helps distinguish between different rpi versions when debugging the log from a problem report. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* util: Use path of script instead of current directory for git versionKevin O'Connor2017-01-091-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Add support for M115 commandKevin O'Connor2016-12-281-5/+4
| | | | | | Support querying the firmware type and version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Log the host software git version at startupKevin O'Connor2016-12-241-2/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Clear "hupcl" bit from serial portKevin O'Connor2016-12-091-0/+6
| | | | | | | | The arduino style serial port interfaces can reset the MCU when the serial port is opened. Clearing the HUPCL flag makes this less likely. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+32
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>