Skip to content
Snippets Groups Projects
Commit c52e6909 authored by Aaron Brashears's avatar Aaron Brashears
Browse files

make it easer for developers to examine list output by sorting the results...

make it easer for developers to examine list output by sorting the results prior to display. DEV-25457
parent fb793870
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,18 @@ from sets import Set as set, ImmutableSet as frozenset ...@@ -80,6 +80,18 @@ from sets import Set as set, ImmutableSet as frozenset
from indra.base import llsd from indra.base import llsd
from indra.util import helpformatter from indra.util import helpformatter
# *HACK: Necessary for python 2.3. Consider removing this code wart
# after etch has deployed everywhere. 2008-12-23 Phoenix
try:
sorted = sorted
except NameError:
def sorted(in_list):
"Return a list which is a sorted copy of in_list."
# Copy the source to be more functional and side-effect free.
out_list = copy.copy(in_list)
out_list.sort()
return out_list
class InstallFile(object): class InstallFile(object):
"This is just a handy way to throw around details on a file in memory." "This is just a handy way to throw around details on a file in memory."
def __init__(self, pkgname, url, md5sum, cache_dir, platform_path): def __init__(self, pkgname, url, md5sum, cache_dir, platform_path):
...@@ -309,7 +321,7 @@ class Installer(object): ...@@ -309,7 +321,7 @@ class Installer(object):
def list_installables(self): def list_installables(self):
"Return a list of all known installables." "Return a list of all known installables."
return self._installables.keys() return sorted(self._installables.keys())
def detail_installable(self, name): def detail_installable(self, name):
"Return a installable definition detail" "Return a installable definition detail"
...@@ -317,7 +329,7 @@ class Installer(object): ...@@ -317,7 +329,7 @@ class Installer(object):
def list_licenses(self): def list_licenses(self):
"Return a list of all known licenses." "Return a list of all known licenses."
return self._licenses.keys() return sorted(self._licenses.keys())
def detail_license(self, name): def detail_license(self, name):
"Return a license definition detail" "Return a license definition detail"
...@@ -325,7 +337,7 @@ class Installer(object): ...@@ -325,7 +337,7 @@ class Installer(object):
def list_installed(self): def list_installed(self):
"Return a list of installed packages." "Return a list of installed packages."
return self._installed.keys() return sorted(self._installed.keys())
def detail_installed(self, name): def detail_installed(self, name):
"Return file list for specific installed package." "Return file list for specific installed package."
......
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