Created
December 12, 2011 01:23
-
-
Save davehull/1464048 to your computer and use it in GitHub Desktop.
Convert dictionary of file system metadata to a sorted list of dictionaries.
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
Takes the unsorted Python dictionary of file system metadata created by | |
git://gist.github.com/1463512.git and converts it to a sorted list of dictionaries containing | |
files and their metadata elements. | |
def get_meta_by_dir(dictionary): | |
# Sort the dictionary, return a list of dictionaries | |
items = [(pname, fname) for pname, fname in dictionary.items()] | |
items.sort() | |
return items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment