Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add ability to sort like the file browser for each operating system #123

Merged
merged 7 commits into from
Nov 19, 2020

Conversation

SethMMorton
Copy link
Owner

@SethMMorton SethMMorton commented Nov 18, 2020

This introduces os_sorted, os_sort_keygen, and os_sort_key. These functions attempt to sort its input the same as the file browser on the user's operating system.

Sadly, for UNIX systems you need PyICU otherwise the result is not great.

This closes #41.

This will work on any operating system.

The current implementation is known to not work on non-Windows. Future
commits will fix this.
ICU is used to sort on UNIX-based platforms. If not given, the results
are OK, but not exactly what you would expect.
@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #123 (e0d1415) into master (7228707) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
+ Coverage   99.53%   99.56%   +0.02%     
==========================================
  Files          10       10              
  Lines         431      460      +29     
==========================================
+ Hits          429      458      +29     
  Misses          2        2              
Impacted Files Coverage Δ
natsort/__init__.py 100.00% <ø> (ø)
natsort/natsort.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7228707...e0d1415. Read the comment docs.

tests/test_os_sorted.py Outdated Show resolved Hide resolved
@SethMMorton SethMMorton merged commit 949564c into master Nov 19, 2020
@SethMMorton SethMMorton deleted the windows-exporer-sorting branch November 19, 2020 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'_' can't be right sorted in Windows
2 participants