Created
August 7, 2016 17:52
-
-
Save mattst/bc33fb9b337ea27a088815278d265c9c to your computer and use it in GitHub Desktop.
sort_view_items PEP8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sort_view_items(self): | |
cs = self.settings.case_sensitive | |
if self.settings.sort_by_file_name: | |
self.view_items.sort(key = lambda vi: (vi.name if cs else vi.name.lower(), vi.group, vi.tab)) | |
elif self.settings.sort_by_folder: | |
self.view_items.sort(key = lambda vi: (vi.folder, vi.name if cs else vi.name.lower())) | |
elif self.settings.sort_by_syntax: | |
self.view_items.sort(key = lambda vi: (vi.syntax, vi.name if cs else vi.name.lower())) | |
elif self.settings.sort_by_indexes: | |
self.view_items.sort(key = lambda vi: (vi.group, vi.tab)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment