Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

reverse sorting order #63

Open
CagtayFabry opened this issue Oct 14, 2021 · 1 comment
Open

reverse sorting order #63

CagtayFabry opened this issue Oct 14, 2021 · 1 comment

Comments

@CagtayFabry
Copy link

hi and thank you for this handy tool ! 👏

I was wondering if there is an option to reverse the display order of the files?
In case there isn't: Is this where the sorting is taking place?

if dir_icon:
return prepend_dir_icons(sorted(dirs), dir_icon, dir_icon_append) + sorted(files)
else:
return sorted(dirs) + sorted(files)

I might want to play around with it a little so any hints on where to start would be welcome

@crahan
Copy link
Owner

crahan commented Oct 14, 2021

Thank you for the kind words!

You are correct. The sorted(dirs) and sorted(files) statements in both parts of that if statement is where the list of directories and list of files in the current folder are sorted and appended together. You can tweak that to change the sort order. Currently, sorting is always alphabetically with folders before files.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants