virtual_sdcard: Add an option to sort by date
Added an option to sort the files with modified date in reverse, so the most recently uploaded one is at the top.
It should be useful for many LCD screen users so that they can easily reprint the latest file when they are at the printer. Especially if there are a lot of g-code files or not named properly.
Signed-off-by: Nathan Chiu [email protected]
Self review
- Tested on my own printer with and without the option set, and they both worked correctly.
Result of running regression test cases
whitespace checkpassed- regression test with dictionaries 20230921 from here failed at
input_shaper.test. I assume it's caused by the recent bulk sensor update and the test dictionary is out of date.
Protocol error
Traceback (most recent call last):
File "/home/pi/klipper/./klippy/klippy.py", line 180, in _connect
cb()
File "/home/pi/klipper/klippy/mcu.py", line 723, in _connect
self._send_config(None)
File "/home/pi/klipper/klippy/mcu.py", line 653, in _send_config
cb()
File "/home/pi/klipper/klippy/extras/adxl345.py", line 228, in _build_config
self.query_adxl345_cmd = self.mcu.lookup_command(
File "/home/pi/klipper/klippy/mcu.py", line 839, in lookup_command
return CommandWrapper(self._serial, msgformat, cq)
File "/home/pi/klipper/klippy/mcu.py", line 86, in __init__
self._cmd = msgparser.lookup_command(msgformat)
File "/home/pi/klipper/klippy/msgproto.py", line 317, in lookup_command
self._error("Command format mismatch: %s vs %s",
File "/home/pi/klipper/klippy/msgproto.py", line 243, in _error
raise error(self.warn_prefix + (msg % params))
msgproto.error: mcu 'mcu': Command format mismatch: query_adxl345 oid=%c rest_ticks=%u vs query_adxl345 oid=%c clock=%u rest_ticks=%u
-
As stated above, I think it's beneficial to LCD screen users that don't have PC or smartphone at the place the printer is.
-
No new files created and only minor modifications to an existing class.
-
The new config option is updated in
Config_Reference.md. If not specified it falls back to the default action as before so probably not needed to be documented inConfig_Changes.md
Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html
There are some steps that you can take now:
- Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
- Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
- Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.
Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.
Best regards, ~ Your friendly GitIssueBot
PS: I'm just an automated script, not a human being.
@nhchiu don't bother, there are several patches made for this before, but the project manager does not want this feature.
scouring the web, you need to be part of some discord channel to get any of your commits looked after.