Skip to content
Snippets Groups Projects
Commit eb6f1257 authored by Alan De Smet's avatar Alan De Smet
Browse files

Cleanup sorting code

Put sort directly into for loop; don't bother with giving it a variable.
Use named argument instead of relying on positional one.
parent 6ec2323e
No related branches found
No related tags found
No related merge requests found
...@@ -1024,9 +1024,7 @@ def stats_library_call(afn, bfn, var_list=[ ], ...@@ -1024,9 +1024,7 @@ def stats_library_call(afn, bfn, var_list=[ ],
doc_each = do_document and len(names)==1 doc_each = do_document and len(names)==1
doc_atend = do_document and len(names)!=1 doc_atend = do_document and len(names)!=1
sorted_names = sorted(names, None, lambda X:X[0]); for name, epsilon, missing in sorted(names, key=lambda X:X[0]):
for name, epsilon, missing in sorted_names:
# make sure that it's possible to load this variable # make sure that it's possible to load this variable
if not(aFile.is_loadable_type(name)) or not(bFile.is_loadable_type(name)) : if not(aFile.is_loadable_type(name)) or not(bFile.is_loadable_type(name)) :
...@@ -1105,10 +1103,8 @@ def inspect_stats_library_call (afn, var_list=[ ], options_set={ }, do_document= ...@@ -1105,10 +1103,8 @@ def inspect_stats_library_call (afn, var_list=[ ], options_set={ }, do_document=
doc_each = do_document and len(names)==1 doc_each = do_document and len(names)==1
doc_atend = do_document and len(names)!=1 doc_atend = do_document and len(names)!=1
sorted_names = sorted(names, None, lambda X:X[0]); for name, epsilon, missing in sorted(names, key=lambda X:X[0]):
for name, epsilon, missing in sorted_names:
# make sure that it's possible to load this variable # make sure that it's possible to load this variable
if not(aFile.is_loadable_type(name)) : if not(aFile.is_loadable_type(name)) :
LOG.warn(name + " is of a type that cannot be loaded using current file handling libraries included with Glance." + LOG.warn(name + " is of a type that cannot be loaded using current file handling libraries included with Glance." +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment